diff options
author | Georg Brandl <georg@python.org> | 2007-02-09 21:28:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-02-09 21:28:07 (GMT) |
commit | 88fc6646d1b97cb3ba6188808e7c016884d44a73 (patch) | |
tree | 4cf73aca05a06e89ae71a719c7b2329af51392b8 /Lib/test/test_descrtut.py | |
parent | 08c47ba0df4ba87cdce34c126e5bdb28f8c6034c (diff) | |
download | cpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.zip cpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.tar.gz cpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.tar.bz2 |
* 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.
Diffstat (limited to 'Lib/test/test_descrtut.py')
-rw-r--r-- | Lib/test/test_descrtut.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Lib/test/test_descrtut.py b/Lib/test/test_descrtut.py index 3351b67..001aa49 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 <class 'test.test_descrtut.defaultdict'> - >>> print(type(defaultdict)) # its metatype + >>> print(type(defaultdict)) # its metatype <type 'type'> >>> 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 <class 'test.test_descrtut.defaultdict'> - >>> print(a.__class__) # show its class + >>> print(a.__class__) # show its class <class 'test.test_descrtut.defaultdict'> - >>> 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 >>> |