Steve D'Aprano wrote:
In practice, identity is hardly important in Python, except for a few limited
cases, and the prohibition against using `is` when you mean `==`.

On the contrary, it's a very important concept needed to make
sense of the way things behave when mutation is involved.

Witness e.g. the classic newbie mistake of using [[0]*5]*5
to create a matrix of zeroes. I don't know how to explain
why that goes wrong without using the phrase "same object"
in some way.

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

Reply via email to