summaryrefslogtreecommitdiff
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-27 08:58:23 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-27 08:58:23 +0000
commit33b730e33cb0a63f4030d1587a6196dcde36e965 (patch)
tree1f20b2cdd510692f3904ddb85b0bf446994b4d66 /Lib/test/test_grammar.py
parent6c403597954487e8129221351f72da3735c52c09 (diff)
downloadcpython-git-33b730e33cb0a63f4030d1587a6196dcde36e965.tar.gz
Fix SF bug #1458903 with AST compiler.
def foo((x)): was getting recognized as requiring tuple unpacking which is not correct. Add tests for this case and the proper way to unpack a tuple of one: def foo((x,)): test_inpsect was incorrect before. I'm not sure why it was passing, but that has been corrected with a test for both functions above. This means the test (and therefore inspect.getargspec()) are broken in 2.4.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 5b20ab3d06..45e3c49cf9 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -255,6 +255,10 @@ d22v(1, 2, 3, 4, 5)
d22v(*(1, 2, 3, 4))
d22v(1, 2, *(3, 4, 5))
d22v(1, *(2, 3), **{'d': 4})
+def d31v((x)): pass
+d31v(1)
+def d32v((x,)): pass
+d32v((1,))
### lambdef: 'lambda' [varargslist] ':' test
print 'lambdef'