TP wrote:
Hi everybody,
I have a data structure (a tree) that has one constraint: I can only store
strings in this data structure.
To know if an object foo already exists in memory, I store "str(id(foo))" in
the data structure.
OK.
But how do I get a usable reference from the id value?
For example, if "foo" has a method "bar()", how can I call "foo.bar()"
from "str(id(foo))" (say, 149466208).
You could create a dict with the string as the key and the object as the
value.
--
http://mail.python.org/mailman/listinfo/python-list