summaryrefslogtreecommitdiff
path: root/tests/basics/syntaxerror.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-23 16:50:42 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-23 16:50:42 +0000
commit9a56912ad16065c8fc3670c8d493f922bc54e5b1 (patch)
treeae5ca9edae11e43451d065ebdbabfe4184546672 /tests/basics/syntaxerror.py
parent0e3f29cc9973dc3c522941858f1f0fb4c6b2cba0 (diff)
py/compile: Do proper checking of * and ** in function definition.
This patch checks that there is only one *, and that ** is last in the arg list.
Diffstat (limited to 'tests/basics/syntaxerror.py')
-rw-r--r--tests/basics/syntaxerror.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/syntaxerror.py b/tests/basics/syntaxerror.py
index 24c3fe6e4..2ae0183f8 100644
--- a/tests/basics/syntaxerror.py
+++ b/tests/basics/syntaxerror.py
@@ -113,3 +113,11 @@ test_syntax('def f(x):\n nonlocal x')
# can define variable to be both nonlocal and global
test_syntax('def f():\n nonlocal x\n global x')
+
+# can't have multiple *'s
+test_syntax('def f(x, *a, *):\n pass')
+test_syntax('lambda x, *a, *: 1')
+
+# **kw must be last
+test_syntax('def f(x, *a, **kw, r):\n pass')
+test_syntax('lambda x, *a, **kw, r: 1')