is id(self) constant over an object lifetime ?

Jean-Michel Pichavant jeanmichel at sequans.com
Fri Dec 3 08:44:40 EST 2010


Hello fellows,

I would need a unique internal identifier to an object. Can I use the 
object python id ?

class Foo:
    def getUniqueIdentifier():
       return id(self)


This id needs to be unique and constant over the python process lifetime.

JM




More information about the Python-list mailing list