On 2/22/2015 4:25 PM, Marko Rauhamaa wrote:
LJ <luisjoseno...@gmail.com>:

id(b[0])
45855552
[...]
id(b[2])
45855552

Please correct me if I am wrong, but according to this b[2] and b[0]
are the same object. Now,

b[0] is b[2]
False

This is a true statement:

    If X is Y, then id(X) == id(Y).

However, this is generally not a true statement:

    If X is Y, then id(X) is id(Y).

If X and Y exist at the *same time*, then (X is Y) == (id(X) is id(Y)). Since X and Y in the example above do not exist at the same time, it is nonsensical to compare them.

--
Terry Jan Reedy

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

Reply via email to