summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-09-11 22:36:20 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-09-11 22:36:20 (GMT)
commit2e4b0e1d8bb8da01530bb76cb73066aa2e8188ba (patch)
tree9f98db4a5a2281eb2338a16d696f714ddb3fd5b4 /Lib/test/test_ast.py
parent8719ad5ddefadbc08b56a0af91515f050c89c678 (diff)
downloadcpython-2e4b0e1d8bb8da01530bb76cb73066aa2e8188ba.zip
cpython-2e4b0e1d8bb8da01530bb76cb73066aa2e8188ba.tar.gz
cpython-2e4b0e1d8bb8da01530bb76cb73066aa2e8188ba.tar.bz2
Merged revisions 74464 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74464 | benjamin.peterson | 2009-08-15 17:59:21 -0500 (Sat, 15 Aug 2009) | 4 lines better col_offsets for "for" statements with tuple unpacking #6704 Patch from Frank Wierzbicki. ........
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 63e9763..0a832c4 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -60,6 +60,10 @@ exec_tests = [
"break",
# Continue
"continue",
+ # for statements with naked tuples (see http://bugs.python.org/issue6704)
+ "for a,b in c: pass",
+ "[(a,b) for a,b in c]",
+ "((a,b) for a,b in c)",
]
# These are compiled through "single"
@@ -321,6 +325,9 @@ exec_results = [
('Module', [('Pass', (1, 0))]),
('Module', [('Break', (1, 0))]),
('Module', [('Continue', (1, 0))]),
+('Module', [('For', (1, 0), ('Tuple', (1, 4), [('Name', (1, 4), 'a', ('Store',)), ('Name', (1, 6), 'b', ('Store',))], ('Store',)), ('Name', (1, 11), 'c', ('Load',)), [('Pass', (1, 14))], [])]),
+('Module', [('Expr', (1, 0), ('ListComp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
+('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
]
single_results = [
('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Num', (1, 0), 1), ('Add',), ('Num', (1, 2), 2)))]),