Generic singleton

Bruno Desthuilliers bdesth.quelquechose at
Wed Mar 3 22:34:46 CET 2010

mk a écrit :
> does every builtin class have unique id?

Classes are objects. And every object *within a python process* has it's
own unique id. For a definition of "unique" being "unique amongst the
objects living in the process at a given time" - IOW, if an object is
garbage-collected, it's id can (and will) be reused. For the record, in
CPython, the id value is the address of the (virtual) memory location
where the object lives (not that you could do anything of this info from
within Python - no pointers here).

More information about the Python-list mailing list