Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-130775: Allow negative locations inast#130795
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If we cannot bypass the ast.c layer and directly end up in the assemble.c, then this should be the correct approach (I didn't know where we validate the locations).
| {'lineno':-2,'col_offset':0}, | ||
| {'lineno':0,'col_offset':-2}, | ||
| {'lineno':0,'col_offset':-2,'end_col_offset':-2}, | ||
| {'lineno':-2,'end_lineno':-2,'col_offset':0}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
- Off topic: are we already testing that passing a non-int is fine?
- Maybe test with values that are excessively large (either in + or -) just for overflow checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I will open a new issue for that, if we don't. Thanks for the idea.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Misc/NEWS.d/next/Core_and_Builtins/2025-03-03-20-02-45.gh-issue-130775.fEM6T-.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. I just suggest a shorter test name :-)
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Core_and_Builtins/2025-03-03-20-02-45.gh-issue-130775.fEM6T-.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I remove my LGTM vote, I didn't notice that -1 value is still allowed. I'm not sure about rejecting values <=-2.
sobolevn commentedMar 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ok, I followed the idea in#130795 (comment) by@JelleZijlstra and now all negative locations are just allowed. This way we won't have any compat issues and can backport this fix easily. Thanks a lot, everyone! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM.
Looks like#130627 changed a lot of related things. Digging into it. |
bc5233b intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Thanks@sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry,@sobolevn, I could not cleanly backport this to |
Sorry,@sobolevn, I could not cleanly backport this to |
Thanks everyone! 🎉 |
I will work on manual backports today. |
astastGH-132243 is a backport of this pull request to the3.13 branch. |
GH-132260 is a backport of this pull request to the3.12 branch. |
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading.Please reload this page.