New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ast col_offset wrong for list comprehensions, generators and tuples #75424
Comments
With Python 3.5 and 3.6 list comprehensions, generators and tuples have the col_offset for their ast nodes off by 1:
I haven't tried 3.4, the issue could be there too. There are some other related issues bpo-16806 and bpo-21295 but they don't seem quite the same. |
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:
I am not sure whether these changes should be backported to maintained versions. |
I am not sure what parts of this PR should be backported if either. |
Yeah, it's a tough call because it's one of those things others have probably worked around already, so backporting would break the work-arounds. If you don't want to bother backporting, Serhiy, I think it would be fine to not do it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: