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 isaiah
Recipients isaiah
Date 2018-05-15.15:16:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526397382.35.0.682650639539.issue33520@psf.upfronthosting.co.za>
In-reply-to
Content
The `col_offset` of the ast.Tuple node is set to the column offset of the first element, shown in code:

>>> a = "{1,2,3}"
>>> b = ast.parse(a).body[0]                                                                                                                                                                  
>>> b.value.col_offset
0
>>> a = "[1,2,3]"                                                                                                                                                                             
>>> b = ast.parse(a).body[0]                                                                                                                                                                  
>>> b.value.col_offset                                                                                                                                                                        
0                                                                                                                                                                                             
>>> a = "(1,2,3)"                                                                                                                                                                             
>>> ast.parse(a).body[0].value.col_offset                                                                                                                                                     
1 
>>> a = "()"                                                                                                                                                                                  
>>> ast.parse(a).body[0].value.col_offset                                                                                                                                                     
0  

It's correct for dict, set, list, even empty tuple, Though this is not a serious bug, for other python implementations that uses the tests as language spec, this is annoying.
History
Date User Action Args
2018-05-15 15:16:22isaiahsetrecipients: + isaiah
2018-05-15 15:16:22isaiahsetmessageid: <1526397382.35.0.682650639539.issue33520@psf.upfronthosting.co.za>
2018-05-15 15:16:22isaiahlinkissue33520 messages
2018-05-15 15:16:22isaiahcreate