[issue26514] Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented

Josh Rosenberg report at bugs.python.org
Tue Mar 8 17:35:44 EST 2016


Josh Rosenberg added the comment:

It's not exactly what was asked for, but it's actually better (in that the __ne__ default implementation handles NotImplemented correctly). Per the docs at https://docs.python.org/3/reference/datamodel.html#object.__eq__ :

"By default, __ne__() delegates to __eq__() and inverts the result unless it is NotImplemented."

This feature was never backported to 2.7, but it's existed in one form or another for the entire 3.x line.

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26514>
_______________________________________


More information about the Python-bugs-list mailing list