diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-09-27 02:43:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-09-27 02:43:28 (GMT) |
commit | 4905e80c3d2f6abb613d212f0313d1dfe09475dc (patch) | |
tree | df849b7313a57c1d844567bcd45b32f7e89ac0ca /Lib/test/test_parser.py | |
parent | 10430ad7aace46c93939341817b97df48951d5a2 (diff) | |
download | cpython-4905e80c3d2f6abb613d212f0313d1dfe09475dc.zip cpython-4905e80c3d2f6abb613d212f0313d1dfe09475dc.tar.gz cpython-4905e80c3d2f6abb613d212f0313d1dfe09475dc.tar.bz2 |
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.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 9e5d5c1..0ac49da 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 |