-
-
Save basuke/423795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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