[issue23124] Incorrect Integer saving

Adam Carruthers report at bugs.python.org
Sun Dec 28 02:48:19 CET 2014


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 <report at bugs.python.org>
<http://bugs.python.org/issue23124>
_______________________________________


More information about the Python-bugs-list mailing list