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

2022-03-16 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Incorrect exception highlighting for fstring format ___ Python tracker

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

2022-03-16 Thread Daniël van Noord
Daniël van Noord added the comment: This was fixed by https://github.com/python/cpython/pull/27729. On 3.10: ```console >>> ast.parse("f'{a}'").body[0].value.values[0].value.col_offset 3 >>> ast.parse("f'{a:b}'").body[0].value.values[0].value.col_offset 3 ``` The other issue also no longer

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

2021-01-18 Thread daniel hahler
Change by daniel hahler : -- nosy: +blueyed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-08-31 Thread Aaron Meurer
Aaron Meurer added the comment: The same thing occurs with specifiers like {a!r}. -- nosy: +asmeurer ___ Python tracker ___ ___

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

2020-04-06 Thread yang
Change by yang : -- keywords: +patch nosy: +fhsxfhsx nosy_count: 2.0 -> 3.0 pull_requests: +18760 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19398 ___ Python tracker

[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( lineno=2, col_offset=4,

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

2018-11-11 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-11-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[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}'") Module( body=[ Expr( lineno=1,