Closed NoahGaeta closed 4 years ago
it works as expected on "valid" nodes.
>>> print(astunparse.unparse(ast.parse("def x(): return")))
def x():
return
Huh, interesting. I wrote a test for it and I could've swore it failed but I re-tested it and it passed. I thought I hit a corner case with this, sorry about that.
It is legal to do this '''\ def f(): return ''' A fix for the _Return function is this: ''' def _Return(self, t): self.fill("return") if hasattr(t, 'value'): if t.value: self.write(" ") self.dispatch(t.value) '''