-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects
#138075
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
This comment was marked as resolved.
This comment was marked as resolved.
sharktide
left a comment
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.
Do we have tests that reflect this behavior? If not, please add some to verify this behavior is working as expected :)
17bd38f to
1f23c41
Compare
Just added tests that re-evaluation works for new locals and globals, and that it still correctly raises a NameError. |
Co-authored-by: Jelle Zijlstra <[email protected]>
|
Thanks @dr-carlos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…DREF)` objects (pythonGH-138075) (cherry picked from commit 63e01d6) Co-authored-by: dr-carlos <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
|
GH-140929 is a backport of this pull request to the 3.14 branch. |
…RDREF)` objects (GH-138075) (#140929) gh-137969: Fix evaluation of `ref.evaluate(format=Format.FORWARDREF)` objects (GH-138075) (cherry picked from commit 63e01d6) Co-authored-by: dr-carlos <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
|
|
|
|
|
|
|
Odd, not sure why this would fail only on buildbots. Maybe an issue where they run tests in a different order? We can revert for now. |
…t.FORWARDREF)` objects (python#138075)" This reverts commit 63e01d6.
…t=Format.FORWARDREF)` objects (pythonGH-138075) (python#140929)" This reverts commit cdb6fe8.
|
|
|
…DREF)` objects (python#138075) Co-authored-by: Jelle Zijlstra <[email protected]>
…t.FORWARDREF)` objects (python#138075)" (python#140930) This reverts commit 63e01d6.
This fix seemingly preserves type parameter semantics for simple tests - unsure if there is more complex behaviour that it may break.
ref.evaluate(format=Format.FORWARDREF)returns a ForwardRef with a copied__globals__that no longer updates #137969