Message353908
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,
values=[
Str(lineno=2, col_offset=4, s='aaa'),
FormattedValue(
lineno=2,
col_offset=4,
value=Name(lineno=2, col_offset=10, id='foo', ctx=Load()),
conversion=-1,
format_spec=None,
),
Str(lineno=2, col_offset=4, s='bbbccc'),
FormattedValue(
lineno=2,
col_offset=4,
value=Name(lineno=2, col_offset=5, id='bar', ctx=Load()),
conversion=-1,
format_spec=None,
),
Str(lineno=2, col_offset=4, s='dddcccaaaaaaaaaaaaaa'),
FormattedValue(
lineno=2,
col_offset=4,
value=Name(lineno=2, col_offset=5, id='baz', ctx=Load()),
conversion=-1,
format_spec=None,
),
Str(lineno=2, col_offset=4, s='ddd'),
],
),
The reported code position for "foo" is correct (2,10), but not for "bar" (2,5) and "baz" (2,5).
Could you give an estimate as to whether this issue will be looked at any time soon? |
|
Date |
User |
Action |
Args |
2019-10-04 08:53:26 | arminius | set | recipients:
+ arminius, eric.smith |
2019-10-04 08:53:26 | arminius | set | messageid: <1570179206.67.0.660570991885.issue35212@roundup.psfhosted.org> |
2019-10-04 08:53:26 | arminius | link | issue35212 messages |
2019-10-04 08:53:26 | arminius | create | |
|