-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
gh-119180: Avoid going through AST and eval() when possible in annotationlib #124337
Merged
Commits on Sep 22, 2024
-
pythongh-119180: Fix bug where fwdrefs were evaluated in the annotati…
…onlib module scope We were sometimes passing None as the globals argument to eval(), which makes it inherit the globals from the calling scope. Instead, ensure that globals is always non-None. The test was passing accidentally because I passed "annotationlib" as a module object; fix that. Also document the parameters to ForwardRef() and remove two unused private ones.
Configuration menu - View commit details
-
Copy full SHA for 293fb0a - Browse repository at this point
Copy the full SHA 293fb0aView commit details -
pythongh-119180: Optimize annotationlib to avoid creation of AST node…
…s and eval() Often, ForwardRefs represent a single simple name. In that case, we can avoid going through the overhead of creating AST nodes and code objects and calling eval(): we can simply look up the name directly in the relevant namespaces.
Configuration menu - View commit details
-
Copy full SHA for 3cfa504 - Browse repository at this point
Copy the full SHA 3cfa504View commit details
Commits on Sep 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for eaea393 - Browse repository at this point
Copy the full SHA eaea393View commit details -
Configuration menu - View commit details
-
Copy full SHA for e274f99 - Browse repository at this point
Copy the full SHA e274f99View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dc0a68 - Browse repository at this point
Copy the full SHA 0dc0a68View commit details
Commits on Sep 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2f5d504 - Browse repository at this point
Copy the full SHA 2f5d504View commit details -
Configuration menu - View commit details
-
Copy full SHA for 892efe9 - Browse repository at this point
Copy the full SHA 892efe9View commit details -
Configuration menu - View commit details
-
Copy full SHA for fefa126 - Browse repository at this point
Copy the full SHA fefa126View commit details -
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
Configuration menu - View commit details
-
Copy full SHA for ab30124 - Browse repository at this point
Copy the full SHA ab30124View commit details
Commits on Sep 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4b1214e - Browse repository at this point
Copy the full SHA 4b1214eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cebb78e - Browse repository at this point
Copy the full SHA cebb78eView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.