is id(self) constant over an object lifetime ?

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


Jean-Michel Pichavant wrote:
> 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
>
erratum

python process lifetime => object lifetime



More information about the Python-list mailing list