Dan Stromberg <drsali...@gmail.com> writes:

> Are the following two expressions the same?
>
> x is y
>
> Id(x) == id(y)

It depends what you mean by “the same”.

Do they give the same result? Sometimes yes, sometimes no. It depends on
what the types of the values are.

Do they express the same intent? Always no. The first queries object
identity, the second queries object equality.

-- 
 \              “Ridicule is the only weapon which can be used against |
  `\       unintelligible propositions.” —Thomas Jefferson, 1816-07-30 |
_o__)                                                                  |
Ben Finney

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

Reply via email to