mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Add a check that SF bug 516727 is really fixed.
This commit is contained in:
parent
556a938d10
commit
c9e9e40b7b
1 changed files with 10 additions and 0 deletions
|
@ -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..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue