summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_class.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/test/test_class.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
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 c450c80..221fd48 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