aboutsummaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2021-01-03 01:14:21 +0200
committerGitHub <noreply@github.com>2021-01-03 01:14:21 +0200
commit2ea320dddd553298038bb7d6789e50e199332f66 (patch)
treee0388038b94c848cc18922f86ff0cb82e4c44465 /Lib/test
parentNo need to test "istep==1" twice. (GH-24064) (diff)
downloadcpython-2ea320dddd553298038bb7d6789e50e199332f66.tar.gz
cpython-2ea320dddd553298038bb7d6789e50e199332f66.tar.bz2
cpython-2ea320dddd553298038bb7d6789e50e199332f66.zip
bpo-40631: Disallow single parenthesized star target (GH-24027)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unpack_ex.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py
index fcc93829cc3..049e48b13fa 100644
--- a/Lib/test/test_unpack_ex.py
+++ b/Lib/test/test_unpack_ex.py
@@ -346,6 +346,31 @@ Now some general starred expressions (all fail).
...
SyntaxError: can't use starred expression here
+ >>> (*x),y = 1, 2 # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ SyntaxError: can't use starred expression here
+
+ >>> (((*x))),y = 1, 2 # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ SyntaxError: can't use starred expression here
+
+ >>> z,(*x),y = 1, 2, 4 # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ SyntaxError: can't use starred expression here
+
+ >>> z,(*x) = 1, 2 # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ SyntaxError: can't use starred expression here
+
+ >>> ((*x),y) = 1, 2 # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ SyntaxError: can't use starred expression here
+
Some size constraints (all fail.)
>>> s = ", ".join("a%d" % i for i in range(1<<8)) + ", *rest = range(1<<8 + 1)"