summaryrefslogtreecommitdiff
path: root/tests/basics/python34.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-06-14 18:18:01 +1000
committerDamien George <damien.p.george@gmail.com>2017-06-14 18:18:01 +1000
commit1e70fda69fcb4991eb60ed43e610f664ea1319e6 (patch)
treee63d9f11b8ead307833b8d5c5b08f1c00ae60cfd /tests/basics/python34.py
parent696fcde8009b3670e5c4e867600c17a916f9a3b0 (diff)
py/compile: Raise SyntaxError if positional args are given after */**.
In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a positional after * is allowed but uPy has the wrong semantics and passes the arguments in the incorrect order. To prevent incorrect use of a function going unnoticed it is important to raise the SyntaxError in uPy, until the behaviour is fixed to follow CPython 3.5+.
Diffstat (limited to 'tests/basics/python34.py')
-rw-r--r--tests/basics/python34.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/basics/python34.py b/tests/basics/python34.py
index a23f347d6..d5cc59ad6 100644
--- a/tests/basics/python34.py
+++ b/tests/basics/python34.py
@@ -20,6 +20,8 @@ def test_syntax(code):
print("SyntaxError")
test_syntax("f(*a, *b)") # can't have multiple * (in 3.5 we can)
test_syntax("f(**a, **b)") # can't have multiple ** (in 3.5 we can)
+test_syntax("f(*a, b)") # can't have positional after *
+test_syntax("f(**a, b)") # can't have positional after **
test_syntax("() = []") # can't assign to empty tuple (in 3.6 we can)
test_syntax("del ()") # can't delete empty tuple (in 3.6 we can)