On 26.11.2011 22:20, candide wrote:

You already got answers for the "is" vs. "==" difference. I'd like to add the following.

In which cases should we use the is() function ?

"is" is not a function, It's an operator, just like == or +.

is() function makes comparaison of (abstract representation of)
adresses of objects in memory.

That's an implementation detail. CPython (and maybe others) implement "is" in terms of memory addresses. Other implementations might use an object ID number or whatever else.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to