Difference between 'is' and '=='

filipwasilewski at gmail.com filipwasilewski at gmail.com
Mon Mar 27 12:46:03 EST 2006


Clemens Hepper wrote:
> It's strange: python seem to cache constants from 0 to 99:

That's true. The Python api doc says that Python keeps an array of
integer objects for all integers between -1 and 100. See
http://docs.python.org/api/intObjects.html.
This also seems to be true for integers from -5 to -2 on (ActiveState)
Python 2.4.2.

-- 
fw




More information about the Python-list mailing list