Message5179
It's even wrong to use 'is' for comparing integers in CPython, even
regular integers (as opposed to long integers), try the following in
CPython:
>>> a = 1<<10
>>> b = 1<<10
>>> a is b
False
This would however be True for small integers in both CPython and
Jython, since both implementations have a "small integer cache":
>>> a = 1 << 8
>>> b = 1 << 8
>>> a is b
True
But again, this is not something you should rely on. |
|
Date |
User |
Action |
Args |
2009-09-17 08:18:12 | thobes | set | messageid: <1253175492.05.0.175958459128.issue1471@psf.upfronthosting.co.za> |
2009-09-17 08:18:12 | thobes | set | recipients:
+ thobes, fwierzbicki, asnama |
2009-09-17 08:18:12 | thobes | link | issue1471 messages |
2009-09-17 08:18:11 | thobes | create | |
|