Message330194
For list comprehensions and generator expressions this is definitely a bug. But tuples syntax technically does not include surrounded parentheses.
There is also a problem with generator expression passes as a single argument. Generator expression parentheses can be collapsed with function call parentheses: f(a for a in b).
PR 10633 makes the following changes:
* Fixes position for list comprehensions and generator expressions.
* If generator expression parentheses are be collapsed with function call parentheses, the position of the AST node for the generator expression points to the left parenthesis.
* For tuples surrounded with parentheses, the position of the AST node points to the left brace. For tuples without parentheses, it points to the position of the first tuple item.
I am not sure whether these changes should be backported to maintained versions. |
|
Date |
User |
Action |
Args |
2018-11-21 12:20:29 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, benjamin.peterson, yselivanov, samuelcolvin |
2018-11-21 12:20:29 | serhiy.storchaka | set | messageid: <1542802829.88.0.788709270274.issue31241@psf.upfronthosting.co.za> |
2018-11-21 12:20:29 | serhiy.storchaka | link | issue31241 messages |
2018-11-21 12:20:29 | serhiy.storchaka | create | |
|