repr(x) == repr(y) <=> x == y AND eval(repr(x)) == x
Chad Netzer
cnetzer at mail.arc.nasa.gov
Fri Oct 18 16:21:28 EDT 2002
On Friday 18 October 2002 12:56, Chad Netzer wrote:
> Furthermore, a straightforward trick is to wrap your object in a single
> element tuple, and use that as the key. It is a much *MUCH* better
> solution than monkeying with 'eval( repr( x ) )'.
Well, upon further investigation, it appears this trick's main fault is
that it is bollocks. It won't work:
a = {}
b = {}
a[ (b,) ] = 1
I thought the above would work, but it seems not to. Anyone care to explain
why (I'm off to look in the reference manual, in the meantime.)
--
Chad Netzer
cnetzer at mail.arc.nasa.gov
More information about the Python-list
mailing list