On Tue, Mar 17, 2009 at 03:14:39PM -0700, grocery_stocker wrote:
> It seems like id(list[<some value>]) == id(<some value>).

Only when certain immutable objects are involved. It is the
implementation's option to allow different immutable values to be the
same object (same id()). In CPython, this is used to cache strings that
look like identifiers and small integers. This has been discussed here 
a lot; have a look at the archives.

-- 
Josh Holland <j...@joshh.co.uk>
http://joshh.co.uk
madmartian on irc.freenode.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to