Can dictionary values access their keys?

  • Thread starter Matthew Thorley
  • Start date
T

Terry Reedy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top