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

Daniël van Noord report at bugs.python.org
Wed Mar 16 08:17:46 EDT 2022


Daniël van Noord <breeuwer.dragonder.0a at icloud.com> 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 reproduces.

----------
message_count: 3.0 -> 4.0
nosy: +danielnoord
nosy_count: 5.0 -> 6.0
pull_requests: +30022
pull_request: https://github.com/python/cpython/pull/27729

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35212>
_______________________________________


More information about the Python-bugs-list mailing list