➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 arminius
收信人 arminius, eric.smith
日期 2019-10-04.08:53:26
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1570179206.67.0.660570991885.issue35212@roundup.psfhosted.org>
In-reply-to
内容
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?
历史
日期 用户 动作 参数
2019-10-04 08:53:26arminius修改recipients: + arminius, eric.smith
2019-10-04 08:53:26arminius修改messageid: <1570179206.67.0.660570991885.issue35212@roundup.psfhosted.org>
2019-10-04 08:53:26arminius链接issue35212 messages
2019-10-04 08:53:26arminius创建