Python "is" behavior

michalis.avraam at gmail.com michalis.avraam at gmail.com
Fri Jun 20 18:31:57 CEST 2008


I am not certain why this is the case, but...

>>> a = 256
>>> b = 256
>>> a is b
True

>>> a = 257
>>> b = 257
>>> a is b
False

Can anyone explain this further? Why does it happen? 8-bit integer
differences?



More information about the Python-list mailing list