Accessing Objects Based On Their ID

Tim Daneliuk tundra at tundraware.com
Tue Feb 15 06:33:48 EST 2005


This is probably obvious to you Python Geniuses (tm) out there but,
it is very late and I am experiencing Brain Fade:

Given the ID of an object, is there a way to access it?  For example,
if we have the ID of a class instance, is there a way to invoke its
methods and attributes knowning only that ID?  Similarly, if we have the
ID of a function, is there a way to call it?

This comes up because of an implementation I had in mind wherein I
would store the IDs of a notionally linked-list of objects - but without
the link - I just want to store their IDs in the desired order.  But later,
when I want to actually use the objects I need a way to get from ID back
to something accessible in the namespace...

TIA,
-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra at tundraware.com
PGP Key:         http://www.tundraware.com/PGP/




More information about the Python-list mailing list