Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52143 > unrolled thread

Re: Bug? ( () == [] ) != ( ().__eq__([]) )

Started byEthan Furman <ethan@stoneleaf.us>
First post2013-08-07 10:50 -0700
Last post2013-08-07 10:50 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Bug? ( () == [] ) != ( ().__eq__([]) ) Ethan Furman <ethan@stoneleaf.us> - 2013-08-07 10:50 -0700

#52143 — Re: Bug? ( () == [] ) != ( ().__eq__([]) )

FromEthan Furman <ethan@stoneleaf.us>
Date2013-08-07 10:50 -0700
SubjectRe: Bug? ( () == [] ) != ( ().__eq__([]) )
Message-ID<mailman.323.1375897815.1251.python-list@python.org>
On 08/07/2013 02:24 AM, Shiyao Ma wrote:
>
> Sorry. I don't quite get it. As you said, it first tries, leftOperand.__eq__(rightOperand) then if it returns
> NotImplemented, it goes to invoke rightOperand.__eq__(leftOperand). But for any reason, [] == () returns false, why?

A list that is empty is not equal to a tuple that is empty, much like a car that is empty is not equal to a boat that is 
empty.

--
~Ethan~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web