Closed
Description
astfold_body
has a block of code that checks whether const folding created something that looks like a docstring, which was not there before. If it did, then we have a string that came out of folding a const expression. This is not recognised by Python as a docstring, so in order to prevent the compiler from recognising it as such, the astfold_body
converts the AST node into a const f-string node (_PyAST_JoinedStr
), which is also not recognised as a docstring.
This is not covered by tests, so it took me a while to figure out what's going on. I'll add the test.