8000 bpo-43783: add ParamSpecArgs/Kwargs by JelleZijlstra · Pull Request #25298 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43783: add ParamSpecArgs/Kwargs #25298

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
merged 8 commits into from
Apr 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
I'll push the remaining changes manually.

Co-authored-by: Guido van Rossum <guido@python.org>
  • Loading branch information
JelleZijlstra and gvanrossum authored Apr 11, 2021
commit 0f2062beabc7b443245d571edc7ee65aaa4cbc26
2 changes: 1 addition & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ These are not used in annotations. They are building blocks for creating generic
components. ``P.args`` represents the tuple of positional parameters in a
given call and should only be used to annotate ``*args``. ``P.kwargs``
represents the mapping of keyword parameters to their values in a given call,
and should be only be used to annotate ``**kwargs`` or ``**kwds``. Both
and should be only be used to annotate ``**kwargs``. Both
attributes require the annotated parameter to be in scope. At runtime,
``P.args`` and ``P.kwargs`` are instances respectively of
:class:`ParamSpecArgs` and :class:`ParamSpecKwargs`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The ``P.args`` and ``P.kwargs`` attributes of :class:`typing.ParamSpec` are
now instances of the new classes :class:`typing.ParamSpecArgs` and
:class:`typing.ParamSpecKwargs`. Patch by Jelle Zijlstra.
:class:`typing.ParamSpecKwargs`, which enables a more useful ``repr()``. Patch by Jelle Zijlstra.
0