Is __ne__ method autogenerated?

INADA Naoki songofacandy at gmail.com
Fri Dec 7 07:48:30 CET 2012


Thanks a million!


On Fri, Dec 7, 2012 at 3:47 PM, Chris Rebert <clp2 at rebertia.com> wrote:

> On Thursday, December 6, 2012, INADA Naoki wrote:
>
>> The reference says:
>>
>>   The truth of x==y does not imply that x!=y is false.
>>   Accordingly, when defining __eq__(), one should also
>>   define __ne__() so that the operators will behave as expected.
>>
>> (http://docs.python.org/3/reference/datamodel.html#object.__eq__)
>>
>> But I saw different behavior on 3.3:
>> https://gist.github.com/4231096
>>
>> Could anyone teach me what happen about my code?
>>
>
> The reference is not completely accurate in this case. See
>  http://bugs.python.org/issue4395
> "Document auto __ne__ generation; [...]"
>
>
> --
> Cheers,
> Chris
> --
> http://rebertia.com
>



-- 
INADA Naoki  <songofacandy at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121207/9cb7f9b6/attachment.html>


More information about the Python-list mailing list