summaryrefslogtreecommitdiffstats
path: root/Lib/numbers.py
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@gmail.com>2008-02-08 06:45:40 (GMT)
committerJeffrey Yasskin <jyasskin@gmail.com>2008-02-08 06:45:40 (GMT)
commit27d339446af6fbd636c58090c5c7e15ec4551dd9 (patch)
tree82aae0a2457e894e8348178f63bcb4cf7580dd7c /Lib/numbers.py
parentb01aa430d5bf82c59c1440e3384a00845cf1b4a2 (diff)
downloadcpython-27d339446af6fbd636c58090c5c7e15ec4551dd9.zip
cpython-27d339446af6fbd636c58090c5c7e15ec4551dd9.tar.gz
cpython-27d339446af6fbd636c58090c5c7e15ec4551dd9.tar.bz2
Oops! 2.6's Rational.__ne__ didn't work.
Diffstat (limited to 'Lib/numbers.py')
-rw-r--r--Lib/numbers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/numbers.py b/Lib/numbers.py
index e391abc..cbceced 100644
--- a/Lib/numbers.py
+++ b/Lib/numbers.py
@@ -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)