wuwei23 at gmail.com
Wed Mar 5 07:01:04 CET 2014
On 5/03/2014 3:47 PM, Rustom Mody wrote:
> That python is a hll means that machine reprs are intended to be abstracted
> away. 'is' fails to do that -- proof of that being the discrepancy between
> is and ==
The "discrepancy" is because _they're fundamentally different_:
>>> a = b = [1,2]
>>> c = [1,2]
>>> a is b
>>> a is c
>>> a == b
>>> a == c
`is` is used to determine if two names refer to the same object.
`==` is used to determine if they're equivalent in value.
Both have their uses.
More information about the Python-list