Closed cript0nauta closed 5 years ago
Thanks for reporting and including a simple case to reproduce it. I will revisit this soon when I get the chance!
Python continues to surprise me... no clue why ast.Yield
is an expression and not a statement, but it seems it is. Thanks for uncovering this bug, and its interesting side effect.
It works now, thanks!
Hi! I found an issue similar to #62. When certain conditions are met and I rewrite the body of a function, it won't be properly indented, therefore it will produce incorrect or syntactically invalid code.
I found the bug while rewriting some parts of this
HostImporter
class. I shrinked the code to find the minimum code required to trigger the bug and ended up with this:The expected output of running this script should be
But the output is this instead:
This code is incorrect, but not yet syntactically invalid. If you add a third
f3()
method to the K class, then the output will be:This will raise a SyntaxError when executed.