Skip to content

[3.13] gh-151955: Allow more ParamSpec bounds - #152122

Merged
JelleZijlstra merged 1 commit into
python:3.13from
JelleZijlstra:codex/gh-151955-3.13
Jun 24, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.13from
JelleZijlstra:codex/gh-151955-3.13

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) June 24, 2026 19:53
@JelleZijlstra
JelleZijlstra merged commit d43f47b into python:3.13 Jun 24, 2026
42 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant