-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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. |
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