[issue23124] Incorrect Integer saving

2014-12-27 Thread Ezio Melotti
Ezio Melotti added the comment: On CPython small ints are cached to improve performances. This is an implementation detail and "is" should not be used to compare ints (== should be used instead). -- nosy: +ezio.melotti resolution: -> not a bug stage: -> resolved status: open -> closed

[issue23124] Incorrect Integer saving

2014-12-27 Thread Adam Carruthers
Changes by Adam Carruthers : -- nosy: -Adam.Carruthers ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23124] Incorrect Integer saving

2014-12-27 Thread Adam Carruthers
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