summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index b2e7e66..d3ae455 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -417,8 +417,8 @@ def ints():
if verbose: print "Testing int operations..."
numops(100, 3)
# The following crashes in Python 2.2
- vereq((1).__nonzero__(), 1)
- vereq((0).__nonzero__(), 0)
+ vereq((1).__bool__(), True)
+ vereq((0).__bool__(), False)
# This returns 'NotImplemented' in Python 2.2
class C(int):
def __add__(self, other):
@@ -1682,7 +1682,7 @@ def specials():
class Proxy(object):
def __init__(self, x):
self.x = x
- def __nonzero__(self):
+ def __bool__(self):
return not not self.x
def __hash__(self):
return hash(self.x)
@@ -1722,7 +1722,7 @@ def specials():
class DProxy(object):
def __init__(self, x):
self.x = x
- def __nonzero__(self):
+ def __bool__(self):
return not not self.x
def __hash__(self):
return hash(self.x)