how to cast an instance id

Eric Texier erict at millfilm.co.uk
Tue Sep 17 04:32:08 EDT 2002


It there a way to create a new reference of  an object
from the string representation of its id?
Thanks for any help.

class foo:
    def info(self):
        print self

a = foo()
a.info()
ccc = "newa = 0x%x" % id(a)
exec(ccc)






More information about the Python-list mailing list