Unverified Kaydet (Commit) 1396d8fa authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-35224: Add support for NamedExpr to unparse.py (GH-11670)

üst 8f59ee01
...@@ -79,6 +79,13 @@ class Unparser: ...@@ -79,6 +79,13 @@ class Unparser:
self.fill() self.fill()
self.dispatch(tree.value) 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): def _Import(self, t):
self.fill("import ") self.fill("import ")
interleave(lambda: self.write(", "), self.dispatch, t.names) interleave(lambda: self.write(", "), self.dispatch, t.names)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment