Message316708
Thanks for the reply, that's quite reasonable, especially take the generator expression case into consideration. However I found this is not consistent with empty tuple:
>>> a = "()"
>>> ast.parse(a).body[0].value.col_offset
0
It's true that the parenthesis is required to construct a tuple, but if the parenthesis is served as the starting point of the tuple, then the col_offset should be the opening parenthesis. i.e. in the following example, both should start from col 2:
>>> ast.parse("c(i for i in range(10))").body[0].value.args[0].col_offset
2
>>> ast.parse("c((i for i in range(10)))").body[0].value.args[0].col_offset
3 |
|
Date |
User |
Action |
Args |
2018-05-15 19:45:02 | isaiah | set | recipients:
+ isaiah, lukasz.langa |
2018-05-15 19:45:02 | isaiah | set | messageid: <1526413502.34.0.682650639539.issue33520@psf.upfronthosting.co.za> |
2018-05-15 19:45:02 | isaiah | link | issue33520 messages |
2018-05-15 19:45:02 | isaiah | create | |
|