diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-05-05 20:16:41 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-05-05 20:16:41 -0400 |
commit | 025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1 (patch) | |
tree | d769adcb6d4a557a00923f18ed2b0ca8b515a473 /Tools | |
parent | 4ccc1514d070cabe80e8cfa0469dc03c12d08be2 (diff) | |
download | cpython-git-025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1.tar.gz |
PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/parser/unparse.py | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py index 258c648b6b..0c1cc5fe41 100644 --- a/Tools/parser/unparse.py +++ b/Tools/parser/unparse.py @@ -211,16 +211,6 @@ class Unparser: if comma: self.write(", ") else: comma = True self.dispatch(e) - if t.starargs: - if comma: self.write(", ") - else: comma = True - self.write("*") - self.dispatch(t.starargs) - if t.kwargs: - if comma: self.write(", ") - else: comma = True - self.write("**") - self.dispatch(t.kwargs) self.write(")") self.enter() @@ -450,16 +440,6 @@ class Unparser: if comma: self.write(", ") else: comma = True self.dispatch(e) - if t.starargs: - if comma: self.write(", ") - else: comma = True - self.write("*") - self.dispatch(t.starargs) - if t.kwargs: - if comma: self.write(", ") - else: comma = True - self.write("**") - self.dispatch(t.kwargs) self.write(")") def _Subscript(self, t): @@ -543,8 +523,11 @@ class Unparser: self.dispatch(t.kwarg.annotation) def _keyword(self, t): - self.write(t.arg) - self.write("=") + if t.arg is None: + self.write("**") + else: + self.write(t.arg) + self.write("=") self.dispatch(t.value) def _Lambda(self, t): |