Where's the documentation to support the following behavior...

grocery_stocker cdalten at gmail.com
Tue Mar 17 18:14:39 EDT 2009


Given the following....

[cdalten at localhost ~]$ python
Python 2.4.3 (#1, Oct  1 2006, 18:00:19)
[GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> list = [7,8,9]
>>> id(list)
-1209401076
>>> id(list[0])
154303848
>>> id(list[1])
154303836
>>> id(list[2])
154303824
>>> for x in list:
...    print id(x),
...
154303848 154303836 154303824
>>> id(7)
154303848
>>> id(8)
154303836
>>> id(9)
154303824


It seems like id(list[<some value>]) == id(<some value>). However, I
can't find anything in the python documentation that talks about it.
Did I perhaps overlook something?



More information about the Python-list mailing list