[issue13746] ast.Tuple's have an inconsistent "col_offset" value
New submission from Igor Bronshteyn : Consider the following snippet (the file is attached): code starts a = [1, 3.14, 'abc', u'XYZ'] b = (1, 3.14, 'abc', u'XYZ') c = {1 : 3.14, 'abc' : u'XYZ'} = code ends = The list has correct position: (1,4), the dict has correct position too: (3,4). But the position of tuple node (ast.Tuple) has wrong or inconsistent "col_offset" = 5: (2,5). -- files: sample01.py messages: 150950 nosy: bronikkk priority: normal severity: normal status: open title: ast.Tuple's have an inconsistent "col_offset" value type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24187/sample01.py ___ Python tracker <http://bugs.python.org/issue13746> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13746] ast.Tuple's have an inconsistent "col_offset" value
Igor Bronshteyn added the comment: I mean, that AST generated with standard "ast.parse" has nodes with confusing positions. Sorry for the first indistinct message. -- ___ Python tracker <http://bugs.python.org/issue13746> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21992] New AST node Else() should be introduced
New submission from Igor Bronshteyn: Quoting Collin Winter: "I'd like there to be an Else() node for If.orelse, While.orelse, etc. My motivation is that I need the lineno and col_offset values of the "else" statement for a code-coverage utility; as it is, I have to find the last lineno of the if/while/etc suite and the first lineno of the "else" suite and then search between those two for the "else" statement." from: http://bugs.python.org/issue1659410 Lack of position for "else" token hampers implementing of even simple static analysis checker that calculates NCNB (non-comment non-blank) lines (e.g. in a function). -- components: Interpreter Core messages: 223229 nosy: Igor.Bronshteyn priority: normal severity: normal status: open title: New AST node Else() should be introduced type: enhancement versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue21992> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com