-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-141388: Improve support for non-function callables as annotate functions #142327
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
Open
dr-carlos
wants to merge
24
commits into
python:main
Choose a base branch
from
dr-carlos:non-function-annotate-errs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+159
−4
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
91036ac
Use default values for annotate functions' __globals__, __builtins__,…
dr-carlos 414251b
Improve error messages for annotate functions missing __code__ attribute
dr-carlos fd6125d
Add non-function annotate tests
dr-carlos c008676
Don't require __closure__ and __globals__ on annotate functions
dr-carlos 1ab0139
Clarify type of annotate function in glossary
dr-carlos e177621
Improve backup paths for annotate functions without __builtins__
dr-carlos fe84920
Add recipe to docs clarifying how non-function annotate functions work
dr-carlos d42d8ad
Add NEWS entry
dr-carlos 45cb956
Clarify wording in annotate function documentation
dr-carlos eef70c4
Wrap `_build_closure` definition line to < 90 chars
dr-carlos 44f2a45
Clarify NEWS entry
dr-carlos 095cfb5
Change doctest to python codeblock in `Annotate` class recipe
dr-carlos d9bf2e8
Remove wrapping of `annotate.__code__` `AttributeError`s
dr-carlos 943181c
Wrap line in `annotationlib`
dr-carlos a1daa6e
Improve documentation for custom callable annotate functions
dr-carlos 028e0f9
Use pycon instead of python in output blocks
dr-carlos 9cefbaa
Actually use dot points where intended in custom callable doc
dr-carlos 8ec86ee
Fix bullet list indentation
dr-carlos a70a647
Start code block at right indentation
dr-carlos 1737973
Various formatting changes in `library/annotationlib.rst` docs
dr-carlos cbc8466
Fix non-function annotate test for non-wrapped AttributeError
dr-carlos 3bfd2e0
Remove test_non_function_annotate() and add improve AttributeError test
dr-carlos 5440128
Simplify/reduce verbosity of class in `test_full_non_function_annotat…
dr-carlos 46ef8b1
Remove defaults fro non-function annotates in `call_annotate_function()`
dr-carlos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2025-12-06-08-48-26.gh-issue-141449.hQvNW_.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Improve support, error messages, and documentation for non-function callables as | ||
| :term:`annotate functions <annotate function>`. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.