[issue13746] ast.Tuple's have an inconsistent "col_offset" value

2012-01-13 Thread Georg Brandl
Georg Brandl added the comment: This is because the parentheses don't really belong to the tuple literal. You could just as well write b = 1, 3.14, 'abc', u'XYZ' In other cases, the parentheses may be needed for grouping purposes (e.g. in function calls), but they still are only for grouping

[issue13746] ast.Tuple's have an inconsistent "col_offset" value

2012-01-12 Thread Meador Inge
Meador Inge added the comment: I can reproduce this in tip as well: >>> ast.dump(ast.parse('a = (1,2)'), include_attributes=True) "Module(body=[Assign(targets=[Name(id='a', ctx=Store(), lineno=1, col_offset=0)], value=Tuple(elts=[Num(n=1, lineno=1, col_offset=5), Num(n=2, lineno=1, col_offset

[issue13746] ast.Tuple's have an inconsistent "col_offset" value

2012-01-09 Thread Igor Bronshteyn
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 __

[issue13746] ast.Tuple's have an inconsistent "col_offset" value

2012-01-09 Thread Igor Bronshteyn
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 t