X is confusing

Peter Mott peter at monicol.co.uk
Tue Jul 6 22:53:35 CEST 2004


I get this inb the Python interpreter v. 2.3

>>>
>>> X=99
>>> X is 99
True
>>> Y=100
>>> Y is 100
False
>>>

Numbers less that 100 get True, more than 100 get False. It seems. What does
this mean? If nothing, then why does it happen? I mean how do you explain
'is' or 'id(X)' to the first time programmer when it does this to you.

Peter





More information about the Python-list mailing list