Why bang your head? It was a stupid hack that has lots of problems, but done in a way that is readable. Sure I could do something more functional or one lined like:
Banana={} names = filter(lambda x:id(eval(x))==id(Banana),dir()) but I am guessing that it is harder to read by many. Anywho I can think of plenty of reasons it would fail, but it really depends on the app. Fredrik Lundh wrote: > Andy Terrel wrote: > > > for i in dir(): > > if eval(i) == Banana: > > print i > > (sound of head hitting desk) > > </F> -- http://mail.python.org/mailman/listinfo/python-list