is id(self) constant over an object lifetime ?

Christian Heimes lists at cheimes.de
Fri Dec 3 09:58:05 EST 2010


Am 03.12.2010 14:53, schrieb Jean-Michel Pichavant:
> Next time I promise to look at the doc before actually asking the 
> question here :)

You are misinterpreting the excerpt. You are right that the id of an
object doesn't change during the lifetime of a Python process and as
long as it stays inside a single process. However if you use some sort
of persistence layer like pickles or an IPC mechanism like
multiprocessing the id is definitely not constant. If you need something
stable, I suggest you look at the uuid module.

Christian




More information about the Python-list mailing list