]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a check that SF bug 516727 is really fixed.
authorGuido van Rossum <guido@python.org>
Mon, 11 Mar 2002 13:21:25 +0000 (13:21 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 11 Mar 2002 13:21:25 +0000 (13:21 +0000)
Lib/test/test_descr.py

index 696e99c92790571e65bb52dab4eeb5a4b3d5b65f..32940eb9ebd35cc63f16d19c482ec05ba659f35b 100644 (file)
@@ -429,6 +429,16 @@ def ints():
     # The following crashes in Python 2.2
     vereq((1).__nonzero__(), 1)
     vereq((0).__nonzero__(), 0)
+    # This returns 'NotImplemented' in Python 2.2
+    class C(int):
+        def __add__(self, other):
+            return NotImplemented
+    try:
+        C() + ""
+    except TypeError:
+        pass
+    else:
+        raise TestFailed, "NotImplemented should have caused TypeErrpr"
 
 def longs():
     if verbose: print "Testing long operations..."