Issue #21408: The default __ne__() now returns NotImplemented if __eq__()

returned NotImplemented.  Removed incorrect implementations of __ne__().
This commit is contained in:
Serhiy Storchaka 2015-01-26 10:04:15 +02:00
commit 34af5023fc
11 changed files with 77 additions and 47 deletions

View file

@ -481,9 +481,6 @@ class Example:
self.options == other.options and \
self.exc_msg == other.exc_msg
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash((self.source, self.want, self.lineno, self.indent,
self.exc_msg))
@ -548,9 +545,6 @@ class DocTest:
self.filename == other.filename and \
self.lineno == other.lineno
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash((self.docstring, self.name, self.filename, self.lineno))
@ -2291,9 +2285,6 @@ class DocTestCase(unittest.TestCase):
self._dt_tearDown == other._dt_tearDown and \
self._dt_checker == other._dt_checker
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash((self._dt_optionflags, self._dt_setUp, self._dt_tearDown,
self._dt_checker))