-
Notifications
You must be signed in to change notification settings - Fork 12
Handle lazy annotations for task generators in Python 3.14 #724
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.14 uses pickle protocol 5 by default (instead of protocol 4), which produces different hash values for the same pickled data. Make the test version-aware to use the correct expected hash based on the Python version.
- Remove redundant _snapshot_annotation_locals function (was just a copy) - Use _caller_locals directly instead of double-copying - Fix priority order in _build_evaluation_locals: snapshot locals now have highest priority over default arguments - Use public API inspect.Parameter.empty instead of inspect._empty - Clean up duplicate docstring entries for id, kwargs, produces - Remove unnecessary C901 noqa (function simplified)
Instead of recursively calling task() and passing captured locals via a parameter, detect the no-parentheses case early and call wrapper() directly. The closure captures caller_locals, eliminating the need for the parameter. This simplifies the public API while maintaining the same behavior for deferred annotation evaluation in Python 3.14+.
e9c37f8 to
a4ed617
Compare
4e56ae0 to
b857f67
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
Provide a description and/or bullet points to describe the changes in this PR.
Todo