En Sat, 19 May 2007 20:42:53 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió:
>>>> z = id(results) >>>> for x in globals().values(): > ... if id(x)==z: break > ... > > This gives me a variable x that is indeed another ref to the results > variable: >>>> x is results > True >>>> x.x > 123 > > Now is there anything better than this search technique to get back a > variable, given its id? py> class A:pass ... py> class B:pass ... py> a=A() py> id(a) 10781400 py> del a py> b=B() py> id(b) 10781400 Now if you look for id=10781400 you'll find b, which is another, absolutely unrelated, object. Enabling this pointer -> objects ability would bring into Python the "wild pointer" nightmare of C programs... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list