summaryrefslogtreecommitdiff
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-09-27 02:43:28 +0000
committerBenjamin Peterson <benjamin@python.org>2009-09-27 02:43:28 +0000
commit8ccabc0faaf6b0af4ba2483c6212f324815fbef1 (patch)
tree966e4a08517baad4e4ffe16131d552883c74b45f /Lib/test/test_parser.py
parent01de313c26c12b4b1b965d495deef88ef4cf1995 (diff)
downloadcpython-8ccabc0faaf6b0af4ba2483c6212f324815fbef1.tar.gz
fix an ambiguity in the grammar from the implementation of extended unpacking
(one which was strangely "resolved" by pgen) This also kills the unused testlist1 rule and fixes parse tree validation of extended unpacking.
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 9e5d5c1ea4..0ac49da338 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -242,6 +242,12 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
(0, '', 2, -1)],
terminals)
+ def test_extended_unpacking(self):
+ self.check_suite("*a = y")
+ self.check_suite("x, *b, = m")
+ self.check_suite("[*a, *b] = y")
+ self.check_suite("for [*x, b] in x: pass")
+
#
# Second, we take *invalid* trees and make sure we get ParserError