mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
10430ad7aa
commit
4905e80c3d
8 changed files with 1119 additions and 1085 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue