On 2006-06-29, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> Now what about this:
>
id(600)
> 134745616
id(601)
> 134745616
>
> id of an object is unique *for the lifetime of this object*. Nothing
> prevents it from being reused later.
Indeed. Since in CPython, it's the address of
James Stroud a écrit :
> Hello all,
>
> What /is/ identity in python?
A unique identifier associated with each and every object in the
process. What exactly is this identifier is left to the implementation -
FWIW and IIRC, CPython uses the memory address of the C 'object'
datastructure.
> For
Hello all,
What /is/ identity in python? For example, we can always count on
py> None is None
True
But I have noticed that this works for strings:
py> "none" is "none"
True
and, for example, integers:
py> 42 is 42
True
And I have noticed that this works for equivalent expressions:
py> 42 is