bpo-33348: parse expressions after * and ** in lib2to3 (GH-6586)

These are valid even in python 2.7


https://bugs.python.org/issue33348



Automerge-Triggered-By: @gpshead
This commit is contained in:
Zsolt Dollenstein 2019-10-23 23:19:07 -07:00 committed by Miss Skeleton (bot)
parent 3bbb6db545
commit 96b06aefe2
6 changed files with 14 additions and 11 deletions

View file

@ -253,6 +253,13 @@ class TestUnpackingGeneralizations(GrammarTest):
def test_double_star_dict_literal_after_keywords(self):
self.validate("""func(spam='fried', **{'eggs':'scrambled'})""")
def test_double_star_expression(self):
self.validate("""func(**{'a':2} or {})""")
self.validate("""func(**() or {})""")
def test_star_expression(self):
self.validate("""func(*[] or [2])""")
def test_list_display(self):
self.validate("""[*{2}, 3, *[4]]""")