From 88fc6646d1b97cb3ba6188808e7c016884d44a73 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 9 Feb 2007 21:28:07 +0000 Subject: * Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes. * Fix some docstrings and one Print -> print. * Fix test_{class,code,descrtut,dis,extcall,parser,popen,pkg,subprocess,syntax,traceback}. These were the ones that generated code with a print statement. In most remaining failing tests there's an issue with the soft space. --- Lib/test/test_descrtut.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'Lib/test/test_descrtut.py') diff --git a/Lib/test/test_descrtut.py b/Lib/test/test_descrtut.py index 3351b67ecb..001aa4949a 100644 --- a/Lib/test/test_descrtut.py +++ b/Lib/test/test_descrtut.py @@ -36,28 +36,28 @@ test_1 = """ Here's the new type at work: - >>> print(defaultdict) # show our type + >>> print(defaultdict) # show our type - >>> print(type(defaultdict)) # its metatype + >>> print(type(defaultdict)) # its metatype >>> a = defaultdict(default=0.0) # create an instance - >>> print(a) # show the instance + >>> print(a) # show the instance {} - >>> print(type(a)) # show its type + >>> print(type(a)) # show its type - >>> print(a.__class__) # show its class + >>> print(a.__class__) # show its class - >>> print(type(a) is a.__class__) # its type is its class + >>> print(type(a) is a.__class__) # its type is its class True >>> a[1] = 3.25 # modify the instance - >>> print(a) # show the new value + >>> print(a) # show the new value {1: 3.25} - >>> print(a[1]) # show the new item + >>> print(a[1]) # show the new item 3.25 - >>> print(a[0]) # a non-existant item + >>> print(a[0]) # a non-existant item 0.0 >>> a.merge({1:100, 2:200}) # use a dict method - >>> print(sortdict(a)) # show the result + >>> print(sortdict(a)) # show the result {1: 3.25, 2: 200} >>> @@ -67,10 +67,11 @@ statement or the built-in function eval(): >>> print(sorted(a.keys())) [1, 2] - >>> exec("x = 3; print x", a) + >>> a['print'] = print # need the print function here + >>> exec("x = 3; print(x)", a) 3 >>> print(sorted(a.keys(), key=lambda x: (str(type(x)), x))) - [1, 2, '__builtins__', 'x'] + [1, 2, '__builtins__', 'print', 'x'] >>> print(a['x']) 3 >>> -- cgit v1.2.1