Skip to content

Instantly share code, notes, and snippets.

@basuke
Last active April 29, 2023 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basuke/423795 to your computer and use it in GitHub Desktop.
Save basuke/423795 to your computer and use it in GitHub Desktop.
class Boo(object):
pass
b = Boo()
def test(n):
b.n = n
m = 0 + n # int オブジェクトをコピー
print(n, b.n is m)
test(-6) # -6,-5を境にFalseになる!
test(-5)
test(-1)
test(0)
test(1)
test(255)
test(256)
test(257) # 256,257を境にFalseになる!
test(10000000000000000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment