Thanks to all, but :
- I should have said that I work with Python 3. Does that matter ?
- May I reformulate the queston : "a is b" and "id(a) == id(b)"
both mean : "a et b share the same physical address". Is that True ?
Thanks,
franck
In article <[email protected]>,
Benjamin Kaplan <[email protected]> wrote:
> On Tue, Sep 4, 2012 at 11:30 PM, Franck Ditter <[email protected]> wrote:
> > Hi !
> > a is b <==> id(a) == id(b) in builtin classes.
> > Is that true ?
> > Thanks,
> >
> > franck
>
> No. It is true that if a is b then id(a) == id(b) but the reverse is
> not necessarily true. id is only guaranteed to be unique among objects
> alive at the same time. If objects are discarded, their ids may be
> reused even though the objects are not the same.
--
http://mail.python.org/mailman/listinfo/python-list