assymetry between a == b and a.__eq__(b)

Peter Otten __peter__ at web.de
Sat Dec 4 12:29:46 EST 2004


Tim Peters wrote:

> See the Python (language, not library) reference manual, section 3.3.8
> ("Coercion rules"), bullet point starting with:
> 
>     Exception to the previous item: if the left operand is an
>     instance of a built-in type or a new-style class, and the right
>     operand is an instance of a proper subclass of that type or
>     class, ...

So that is settled then. Not the most likely place to investigate when one
has just read that "Arguments to rich comparison methods are never coerced"
in 3.3.1 ("Basic customization"), though.

Peter




More information about the Python-list mailing list