summaryrefslogtreecommitdiff
path: root/Lib/test/test_class.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_class.py')
-rw-r--r--Lib/test/test_class.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index c450c808d3..221fd48dcf 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -65,63 +65,63 @@ testmeths = [
class AllTests:
def __hash__(self, *args):
- print "__hash__:", args
+ print("__hash__:", args)
return hash(id(self))
def __str__(self, *args):
- print "__str__:", args
+ print("__str__:", args)
return "AllTests"
def __repr__(self, *args):
- print "__repr__:", args
+ print("__repr__:", args)
return "AllTests"
def __int__(self, *args):
- print "__int__:", args
+ print("__int__:", args)
return 1
def __float__(self, *args):
- print "__float__:", args
+ print("__float__:", args)
return 1.0
def __oct__(self, *args):
- print "__oct__:", args
+ print("__oct__:", args)
return '01'
def __hex__(self, *args):
- print "__hex__:", args
+ print("__hex__:", args)
return '0x1'
def __cmp__(self, *args):
- print "__cmp__:", args
+ print("__cmp__:", args)
return 0
def __eq__(self, *args):
- print "__eq__:", args
+ print("__eq__:", args)
return True
def __ne__(self, *args):
- print "__ne__:", args
+ print("__ne__:", args)
return False
def __lt__(self, *args):
- print "__lt__:", args
+ print("__lt__:", args)
return False
def __le__(self, *args):
- print "__le__:", args
+ print("__le__:", args)
return True
def __gt__(self, *args):
- print "__gt__:", args
+ print("__gt__:", args)
return False
def __ge__(self, *args):
- print "__ge__:", args
+ print("__ge__:", args)
return True
def __del__(self, *args):
- print "__del__:", args
+ print("__del__:", args)
# Synthesize AllTests methods from the names in testmeths.
@@ -186,7 +186,7 @@ class Empty: pass
try:
1 in Empty()
- print 'failed, should have raised TypeError'
+ print('failed, should have raised TypeError')
except TypeError:
pass
@@ -224,9 +224,9 @@ if sys.platform[:4] != 'java':
else:
# This works under Jython, but the actual slice values are
# different.
- print "__getitem__: (slice(0, 42, None),)"
- print "__setitem__: (slice(0, 42, None), 'The Answer')"
- print "__delitem__: (slice(0, 42, None),)"
+ print("__getitem__: (slice(0, 42, None),)")
+ print("__setitem__: (slice(0, 42, None), 'The Answer')")
+ print("__delitem__: (slice(0, 42, None),)")
# Unary operations
@@ -265,14 +265,14 @@ if sys.platform[:4] == 'java':
class ExtraTests:
def __getattr__(self, *args):
- print "__getattr__:", args
+ print("__getattr__:", args)
return "SomeVal"
def __setattr__(self, *args):
- print "__setattr__:", args
+ print("__setattr__:", args)
def __delattr__(self, *args):
- print "__delattr__:", args
+ print("__delattr__:", args)
testme = ExtraTests()
testme.spam
@@ -349,7 +349,7 @@ try:
A().a # Raised AttributeError: A instance has no attribute 'a'
except AttributeError as x:
if str(x) != "booh":
- print "attribute error for A().a got masked:", str(x)
+ print("attribute error for A().a got masked:", str(x))
class E:
__eq__ = property(booh)
@@ -362,7 +362,7 @@ try:
except AttributeError as x:
pass
else:
- print "attribute error for I.__init__ got masked"
+ print("attribute error for I.__init__ got masked")
# Test comparison and hash of methods