Skip to content
Permalink
Browse files

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

  • Loading branch information...
vstinner committed Jan 25, 2019
1 parent 8f59ee0 commit 1396d8fab4d0ae830d45f4937322bbb43ce0c30e
Showing with 7 additions and 0 deletions.
  1. +7 −0 Tools/parser/unparse.py
@@ -79,6 +79,13 @@ def _Expr(self, tree):
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)

0 comments on commit 1396d8f

Please sign in to comment.
You can’t perform that action at this time.