gh-143089: Fix ParamSpec default examples to use list instead of tuple#143179
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
sobolevn
left a comment
There was a problem hiding this comment.
There's another case of default=() in test_paramspec, please fix it as well.
Misc/NEWS.d/next/Documentation/2025-12-25-19-49-03.gh-issue-143089._vbPkt.rst
Outdated
Show resolved
Hide resolved
7844a4a to
df4cf50
Compare
|
Actually why didn't you update the test? |
|
I originally updated the test, but reverted it after CI showed that the runtime default is still expected to be a tuple. So only the docs/examples now use list syntax. |
|
Mmmh, should we actually enforce it at runtime then? maybe as a follow-up PR? cc @JelleZijlstra |
|
That sounds good — I’d be happy to help with a follow-up PR if needed |
|
Thanks @VanshAgarwal24036 for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…f tuple (pythonGH-143179) (cherry picked from commit 67d3d03) Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
…f tuple (pythonGH-143179) (cherry picked from commit 67d3d03) Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
|
GH-143538 is a backport of this pull request to the 3.14 branch. |
|
GH-143539 is a backport of this pull request to the 3.13 branch. |
This PR fixes incorrect ParamSpec default examples in the ParamSpec
docstring shown by help(ParamSpec).
According to the typing specification, ParamSpec defaults must be a list
literal, ellipsis (
...), or another ParamSpec. Tuples are not permitted.The docstring examples previously used tuple defaults. These are updated
to use list defaults to match the typing specification and the existing
documentation.
Closes: gh-143089