Repository navigation
[3.13] gh-151955: Allow more ParamSpec bounds - #152122
Merged
Merged
Conversation
Documentation build overview
465 files changed ·
|
JelleZijlstra
enabled auto-merge (squash)
June 24, 2026 19:53
gaborbernat
added a commit
to tox-dev/sphinx-autodoc-typehints
that referenced
this pull request
Oct 14, 2026
…911) On Python 3.12 and 3.13 before 3.13.16, an unbound [`ParamSpec`](https://docs.python.org/3/library/typing.html#typing.ParamSpec) rendered with a `bound="None"` it never had. 🐛 For `def call(func: Callable[P, int])`: ```diff - **func** ("Callable"["ParamSpec"("P", bound="None"), "int"]) -- - the function to call + **func** ("Callable"["ParamSpec"("P"), "int"]) -- the function + to call ``` Those interpreters store `NoneType` as the bound, fixed upstream in [CPython gh-151955](python/cpython#151955) and [backported to 3.13](python/cpython#152122). #867 already skips it in a generic's header; the annotation renderer now drops it too. A real bound such as `bound=str` still shows.
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
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.
Backport of gh-151956 to 3.13.