the address of list.append and list.append.__doc__

Fredrik Lundh fredrik at pythonware.com
Wed Sep 26 04:47:10 EDT 2007


HYRY wrote:

> This works, but I think the key of DOC is too long, so I want to use
> the id of list.append.__doc__ as the key; or use the id of
> list.append:
> 
> DOC[id(list.append.__doc__)] = "..."
> DOC[id(list.append)] = "..."
> 
> So, I asked how to get list.append from a.append, and why
> id(list.append.__doc__) changes.

dictionaries hold *references* to objects, not copies of the object 
values, so that won't save you anything.

</F>




More information about the Python-list mailing list