summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-02-10 02:12:43 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-02-10 02:12:43 (GMT)
commitde8b94c3e1154eb7778a6d5729129b6a57c365fb (patch)
tree2effb80775d5abf238626f99d062acae6ceb5438 /Lib/test
parent9caf9c040e4cf176eb926a077ae7bcdb6550160b (diff)
downloadcpython-de8b94c3e1154eb7778a6d5729129b6a57c365fb.zip
cpython-de8b94c3e1154eb7778a6d5729129b6a57c365fb.tar.gz
cpython-de8b94c3e1154eb7778a6d5729129b6a57c365fb.tar.bz2
Fix SF bug #683467, 'int' ability to generate longs not inherited
When subclassing from an int but not overriding __new__, long values were not converted properly. Try to convert longs into an int.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 8a6a538..8ef7979 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -458,12 +458,20 @@ def ints():
class C(int):
def __add__(self, other):
return NotImplemented
+ vereq(C(5L), 5)
try:
C() + ""
except TypeError:
pass
else:
raise TestFailed, "NotImplemented should have caused TypeError"
+ import sys
+ try:
+ C(sys.maxint+1)
+ except OverflowError:
+ pass
+ else:
+ raise TestFailed, "should have raised OverflowError"
def longs():
if verbose: print "Testing long operations..."