Browse Source
bpo-35224: Add support for NamedExpr to unparse.py (GH-11670)
pull/6448/head
Victor Stinner
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
Tools/parser/unparse.py
|
|
|
@ -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) |
|
|
|
|