Message124665
Hi,
yeah Terry, that's exactly what most people whom I talked about this said (me too).
Anyway, here's the patch which -- in my opinion -- fixes this behavior:
--- python-orig/Python/ast.c 2010-10-19 03:22:07.000000000 +0200
+++ python-ast-fix/Python/ast.c 2010-12-26 13:25:48.000000000 +0100
@@ -1742,8 +1742,6 @@
tmp = ast_for_trailer(c, ch, e);
if (!tmp)
return NULL;
- tmp->lineno = e->lineno;
- tmp->col_offset = e->col_offset;
e = tmp;
}
if (TYPE(CHILD(n, NCH(n) - 1)) == factor) {
The offsets for "foo.bar.baz" before the patch:
[1, 0, <_ast.Attribute>]
[1, 0, <_ast.Attribute>, 'baz']
[1, 0, <_ast.Name>, 'bar']
[1, 0, 'foo']
... and after the patch:
[1, 0, <_ast.Attribute>]
[1, 7, <_ast.Attribute>, 'baz']
[1, 3, <_ast.Name>, 'bar']
[1, 0, 'foo']
It would really be great if that could be applied.
Best regards,
Sven |
|
Date |
User |
Action |
Args |
2010-12-26 12:46:25 | scummos | set | recipients:
+ scummos, georg.brandl, rhettinger, terry.reedy, benjamin.peterson |
2010-12-26 12:46:25 | scummos | set | messageid: <1293367585.59.0.17008691647.issue10769@psf.upfronthosting.co.za> |
2010-12-26 12:46:10 | scummos | link | issue10769 messages |
2010-12-26 12:46:09 | scummos | create | |
|