diff options
Diffstat (limited to 'Lib/numbers.py')
-rw-r--r-- | Lib/numbers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/numbers.py b/Lib/numbers.py index 4dd5ca7..b5150d2 100644 --- a/Lib/numbers.py +++ b/Lib/numbers.py @@ -154,7 +154,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) |