On 9/5/2012 8:48 AM, Ramchandra Apte wrote:

Seeing this thread, I think the is statment should be removed.
It has a replacement syntax of id(x) == id(y)

The thread is wrong then.

If the implementation reuses ids, which CPython does,
<expression-1> is <expression-2>
must be implemented as

internal-tem1 = <expression-1>
internal-tem2 = <expression-2>
id(internal-tem1) == id(internal-tem2)

in order to ensure that the two objects exist simultaneously,
so that the id comparison is valid.

> and "a==True" should be automatically changed into memory comparison.

I have no idea what that means.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to