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
bpo-46042: Improve SyntaxError locations in the symbol table #30059
Conversation
Looks good to me! I like the macros and just having |
I think we could be even more general. It seems the other two remaining uses of [x for x in range(10)
if (yield) == 5] def f():
from math import * |
The second one is a bit more complex because we would need to identify which of the comprehension generators have a 'yield' inside, but that happens downstream from us in the visitors. |
From the second example I have submitted another commit |
PyPy has the equivalent of an extra |
We would need to also know the comprehension type to raise properly, which is a bit messy. Do you have one extra enum or 4 extra ones? Edit: I did a prototype but is quite long so I will do this in another PR |
Nevermind, I found a better workaround that is not too inelegant IMHO |
Nice, that's a good approach! |
Thanks @pablogsal for the PR |
GH-30064 is a backport of this pull request to the 3.10 branch. |
|
https://bugs.python.org/issue46042