Message361595
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. |
|
Date |
User |
Action |
Args |
2020-02-07 14:44:54 | lys.nikolaou | set | recipients:
+ lys.nikolaou, gvanrossum, pablogsal |
2020-02-07 14:44:54 | lys.nikolaou | set | messageid: <1581086694.35.0.395827343786.issue39579@roundup.psfhosted.org> |
2020-02-07 14:44:54 | lys.nikolaou | link | issue39579 messages |
2020-02-07 14:44:54 | lys.nikolaou | create | |
|