New submission from Adam Carruthers: 255 is 255 -> True (255).bit_length() -> 8 256 is 256 -> True (256).bit_length() -> 9 257 is 257 -> False (257).bit_length() -> 9 ^ Will show True if you do it exactly like this because of a quirk. a = 257 b = 257 a is b -> False
I think you don't want to map variables to integers direct unless they are at or under 8 bits in length. ---------- messages: 233145 nosy: Adam.Carruthers priority: normal severity: normal status: open title: Incorrect Integer saving type: enhancement versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23124> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com