Message5179

Author thobes
Recipients asnama, fwierzbicki, thobes
Date 2009-09-17.08:18:11
SpamBayes Score 2.497904e-07
Marked as misclassified No
Message-id <1253175492.05.0.175958459128.issue1471@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-09-17 08:18:12thobessetmessageid: <1253175492.05.0.175958459128.issue1471@psf.upfronthosting.co.za>
2009-09-17 08:18:12thobessetrecipients: + thobes, fwierzbicki, asnama
2009-09-17 08:18:12thobeslinkissue1471 messages
2009-09-17 08:18:11thobescreate