Is " a is b " and " id(a) == id(b) " the same?

Chen chenpuqing at
Sun Mar 16 09:37:39 CET 2003

"Alex Martelli" <aleax at> wrote in message
news:LNVca.64538$pG1.1493379 at
> Your observation is correct, and shows this common assertion needs
> one extra qualification: "provided objects a and b are alive while
> the whole operation is taking place".  This in turn comes from two
> Python characteristics:

Thanks for your excellent explanation! I learned much. :-)

And add another interesting example for it:

>>> print a.f is a.f

Wow! :-)


More information about the Python-list mailing list