Permanent objects?
Bjorn Pettersen
BPettersen at NAREX.com
Tue Dec 24 13:52:13 EST 2002
> From: Tom Zych [mailto:tztemp13 at pobox.com]
>
> Here's an odd thing Python 2.2 does:
>
[...]
>
> I'm guessing that Python keeps the integers from -1 to 99 as
> permanent objects so it doesn't have to create a brand new
> object for every piddling little [0] and such. Anyone know?
Yes, this has been an undocumented feature for as long as I can remember
(which means 1.4 or so ;-)
-- bjorn
More information about the Python-list
mailing list