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
sorry guys
"
id(/object/)¶ <http://docs.python.org/library/functions.html#id>
Return the “identity” of an object. This is an integer (or long
integer) which is guaranteed to be unique and constant for this
object during its lifetime. Two objects with non-overlapping
lifetimes may have the same id()
<http://docs.python.org/library/functions.html#id> value.
"
Next time I promise to look at the doc before actually asking the
question here :)
JM
--
http://mail.python.org/mailman/listinfo/python-list