Can dictionary values access their keys?

Terry Reedy tjreedy at udel.edu
Fri Apr 8 17:07:23 EDT 2005


> Further, is there much processing required to do the magic? When python
> do introspective magic, is it memory intensive? by that I mean does it
> have to make copies of the objects to do the look-ups?

A Python interpreter never copies *objects* (as opposed to references to 
objects) except when you ask it too.  (This sometimes trips up newbies when 
the copied reference is to an uncopied mutable object that they thought was 
copied.)  For CPython, references are 4 (possibly 8) byte pointers, which 
is smaller than any object.

Terry J. Reedy






More information about the Python-list mailing list