mirror of
https://github.com/python/cpython.git
synced 2025-07-14 14:55:17 +00:00
PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
This commit is contained in:
parent
4ccc1514d0
commit
025e9ebd0a
26 changed files with 2664 additions and 2118 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue