[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2019-10-04 Thread Arminius
Arminius added the comment: There is another instance of incorrectly reported offsets in f-strings, in this case affecting multi-line strings. Example: ( f'aaa{foo}bbb' f'ccc{bar}ddd' f'eee{baz}fff' ) Relevant part of the syntax tree: JoinedStr(

[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2018-11-11 Thread Arminius
New submission from Arminius : ast.parse() will give a wrong code position for an expression inside an f-string when the expression is using a format specifier. Compare the trees of f'{a}' and f'{a:b}' : >>> ast.parse("f'{a}'") Modu