how to get back an object from its id() value

TP Tribulations at Paralleles.invalid
Wed Apr 8 12:20:56 EDT 2009


MRAB wrote:

> You could create a dict with the string as the key and the object as the
> value.

Thanks. But it implies an additional data structure: a dictionnary.
I don't know what is the best:
* using an additional dict and maintaining it
* or using the "di" module proposed by CTO

If "di" is reliable, it seems a good solution for my initial constraint
which is the impossibility to store anything but strings in my data
structure.

-- 
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)



More information about the Python-list mailing list