Oops! 2.6's Rational.__ne__ didn't work.

This commit is contained in:
Jeffrey Yasskin 2008-02-08 06:45:40 +00:00
parent b01aa430d5
commit 27d339446a
2 changed files with 6 additions and 1 deletions

View file

@ -174,7 +174,10 @@ class Complex(Number):
"""self == other"""
raise NotImplementedError
# __ne__ is inherited from object and negates whatever __eq__ does.
def __ne__(self, other):
"""self != other"""
# The default __ne__ doesn't negate __eq__ until 3.0.
return not (self == other)
Complex.register(complex)