Tim Chase wrote:
CPython has the option to cache frequently used items, and does so for a
small range of ints. It's not guaranteed behavior (or a guaranteed
range) so you shouldn't rely on it, but it's an efficiency thing. In my
current version, it looks like it's ints from -5 to 256. YMMV
In general, if you're using "is" (and not comparing with None) or id(),
you're doing it wrong unless you already know the peculiarities of
Python's identity implementations.
Right. Another way to do look at it is that if you're curious about
what the value of `id` is or how the `is` operator works, the short
version is, don't worry about them, as you won't be using them.
I'm really rather surprised at the number of questions about them.
They're really something one does not need to worry about.
--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
All bad poetry springs from genuine feeling.
-- Oscar Wilde
--
http://mail.python.org/mailman/listinfo/python-list