Uh oh!
There was an error while loading. Please reload this page.
gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects - #138075
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
sharktide
left a comment
There was a problem hiding this comment.
Do we have tests that reflect this behavior? If not, please add some to verify this behavior is working as expected :)
17bd38f to
1f23c41Comparedr-carlos
commented
Aug 23, 2025
Just added tests that re-evaluation works for new locals and globals, and that it still correctly raises a NameError. |
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.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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 <77367421+dr-carlos@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-140929 is a backport of this pull request to the 3.14 branch. |
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
JelleZijlstra
commented
Nov 3, 2025
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.
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
bedevere-bot
commented
Nov 3, 2025
|
…DREF)` objects (python#138075) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…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