mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-35224: Add support for NamedExpr to unparse.py (GH-11670)
This commit is contained in:
parent
8f59ee01be
commit
1396d8fab4
1 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,13 @@ class Unparser:
|
|||
self.fill()
|
||||
self.dispatch(tree.value)
|
||||
|
||||
def _NamedExpr(self, tree):
|
||||
self.write("(")
|
||||
self.dispatch(tree.target)
|
||||
self.write(" := ")
|
||||
self.dispatch(tree.value)
|
||||
self.write(")")
|
||||
|
||||
def _Import(self, t):
|
||||
self.fill("import ")
|
||||
interleave(lambda: self.write(", "), self.dispatch, t.names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue