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.

Author lys.nikolaou
Recipients gvanrossum, lys.nikolaou, pablogsal
Date 2020-02-07.14:44:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581086694.35.0.395827343786.issue39579@roundup.psfhosted.org>
In-reply-to
Content
There is a problem with the end_col_offset of nested Attribute nodes in decorators. For example, parsing

@a.b.c
def f(): pass

produces the following AST tree (part):

decorator_list=[
    Attribute(
        value=Attribute(
            value=Name(
                id="a",
                ctx=Load(),
                lineno=1,
                col_offset=1,
                end_lineno=1,
                end_col_offset=2,
            ),
            attr="b",
            ctx=Load(),
            lineno=1,
            col_offset=1,
            end_lineno=1,
            *end_col_offset=6*,
        ),
        attr="c",
        ctx=Load(),
        lineno=1,
        col_offset=1,
        end_lineno=1,
        end_col_offset=6,
    )
],

Note that the Attribute node with attr="b" has end_col_offset=6, while it should actually be 4.
History
Date User Action Args
2020-02-07 14:44:54lys.nikolaousetrecipients: + lys.nikolaou, gvanrossum, pablogsal
2020-02-07 14:44:54lys.nikolaousetmessageid: <1581086694.35.0.395827343786.issue39579@roundup.psfhosted.org>
2020-02-07 14:44:54lys.nikolaoulinkissue39579 messages
2020-02-07 14:44:54lys.nikolaoucreate