Is " a is b " and " id(a) == id(b) " the same?
chenpuqing at 163.net
Sun Mar 16 09:37:39 CET 2003
"Alex Martelli" <aleax at aleax.it> wrote in message
news:LNVca.64538$pG1.1493379 at news1.tin.it...
> 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
More information about the Python-list