Pragmatics of the standard is() function
Alexander Kapps
alex.kapps at web.de
Sat Nov 26 17:38:26 EST 2011
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.
More information about the Python-list
mailing list