-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-47212: Improve error messages for un-parenthesized generator expressions #32302
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
Conversation
@MatthieuDartiailh Can you add/modify some test cases? |
Yeah, definitely we can backport these. |
Sure if I can find them. |
The tests in test_syntax.py do not track the start and end position of the SyntaxError, so I am not sure where to add a test. For the indentation error I found where to add it. |
I think you can add a case to |
I tried to add some tests but did not get a chance to test locally. |
check in test_exceptions does not check the end offset should I add a new method doing that ? |
Ah, that is because it precedes the changes I did in 3.10. Yeah, please, if you don't mind add a check for the end range. Thanks 🙏 |
Tests are now passing. What should I do exactly for bedevere/news ? |
You can use https://blurb-it.herokuapp.com/ to add a NEWS entry :) |
Thanks @AlexWaygood hopefully I did it right |
Misc/NEWS.d/next/Core and Builtins/2022-04-05-11-29-21.bpo-47212.leF4pz.rst
Outdated
Show resolved
Hide resolved
…12.leF4pz.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Thanks @MatthieuDartiailh for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, @MatthieuDartiailh and @pablogsal, I could not cleanly backport this to |
@MatthieuDartiailh Can you do the backport using the |
@pablogsal The cherry pick will be really messy because action_helpers.c does not exist on 3.10. Not sure it is worth backporting then. |
The code for Don't worry if you find it too hard, I can cherry pick myself if you don't want to do it :) |
Bacport is at #32334. Hopefully I got it right |
GH-32334 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit aa0f056) # Conflicts: # Grammar/python.gram # Parser/action_helpers.c Automerge-Triggered-By: GH:pablogsal
Fixes the minor inconsistencies noticed in bpo-47212. Those could be backported to 3.10 but I have no idea what is the policy in that respect.
ping @pablogsal @lysnikolaou
https://bugs.python.org/issue47212