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

Mel Wilson mwilson at the-wire.com
Sat Dec 4 19:14:32 CET 2004


In article <coss5o$1uq$02$1 at news.t-online.com>,
Peter Otten <__peter__ at web.de> wrote:
>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.

   At some point Python will cease to be a simple language.

        Regards.        Mel.



More information about the Python-list mailing list