> On Jan 17, 2019, at 12:39, Peter Otten <__pete...@web.de> wrote:
> 
> One obscure detail of the implementation of list equality:
> 
> In Python an object can be unequal to itself:
> 
>>>> class A:
> ...     def __eq__(self, other): return False
> ... 
>>>> a = A()
>>>> a == a
> False

Isn’t this a bit artificial, though?  The reason this is False is because you 
explicitly tell it to return False when using equality.  That’s not the same 
thing as using __eq__ without overriding it’s behavior internally.


— 
David Rock
da...@graniteweb.com




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to