Question re class variable

John Gordon gordon at panix.com
Tue Sep 29 16:44:40 CEST 2015


In <mudnfg$cqo$1 at speranza.aioe.org> alister <alister.nospam.ware at ntlworld.com> writes:

> why not simply use pythons builtin id function?
> each new instance of an object is automatically assigned a unique ID

It's only guaranteed to be unique for objects that exist at the same time.

If an object is created and destroyed and then another new object is
created, the ID of those two objects can be the same.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"



More information about the Python-list mailing list