Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_parser.py @ 56237:7ee140b7ef93
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.
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sun, 27 Sep 2009 02:43:28 +0000 |
| parents | adf66b52022d |
| children | b2d90c1c637d |
line wrap: on
line diff
--- a/Lib/test/test_parser.py Sat Sep 26 20:59:11 2009 +0000 +++ b/Lib/test/test_parser.py Sun Sep 27 02:43:28 2009 +0000 @@ -242,6 +242,12 @@ (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
