summaryrefslogtreecommitdiffstats
path: root/Tools/parser/unparse.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-05-06 00:16:41 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-05-06 00:16:41 (GMT)
commit025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1 (patch)
treed769adcb6d4a557a00923f18ed2b0ca8b515a473 /Tools/parser/unparse.py
parent4ccc1514d070cabe80e8cfa0469dc03c12d08be2 (diff)
downloadcpython-025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1.zip
cpython-025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1.tar.gz
cpython-025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1.tar.bz2
PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
Diffstat (limited to 'Tools/parser/unparse.py')
-rw-r--r--Tools/parser/unparse.py27
1 files changed, 5 insertions, 22 deletions
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index 258c648..0c1cc5f 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):