[Tutor] a quick Q: built-in method pop of list object at 0x7f8221a22cb0>

Steven D'Aprano steve at pearwood.info
Thu Sep 8 15:56:27 CEST 2011


lina wrote:
> Hi,
> 
> 
> <built-in method pop of list object at 0x7f8221a22cb0>
> 
> 
> what does the 0x7f8221a22cb0 mean here? the computer physical address.

That's the ID of the list object, converted to hexadecimal.

Every object in Python gets a unique (for the life of the object) ID. In 
CPython, the version you are using, that ID happens to be the memory 
address, and can be reused. For Jython and IronPython, the ID is an 
auto-incrementing counter, and will never be re-used:

first object created gets ID 1
second object gets ID 2
third object gets ID 3
...
etc.



-- 
Steven



More information about the Tutor mailing list