is``True如果比较相同的对象实例,则始终返回
而
==最终由该
__eq__()方法确定
即
>>> class Foo(object): def __eq__(self, other):return True>>> f = Foo()>>> f == NoneTrue>>> f is NoneFalse

is``True如果比较相同的对象实例,则始终返回
而
==最终由该
__eq__()方法确定
即
>>> class Foo(object): def __eq__(self, other):return True>>> f = Foo()>>> f == NoneTrue>>> f is NoneFalse