8000 gh-104010: Separate and improve docs for `typing.get_origin` and `typing.get_args` by chgnrdv · Pull Request #104013 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104010: Separate and improve docs for typing.get_origin and typing.get_args #104013

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 6 commits into from
May 10, 2023
Merged
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
removed doubleticks
  • Loading branch information
chgnrdv committed Apr 30, 2023
commit 83dd08293d3d1a266785a977774913c59eb0c75b
4 changes: 2 additions & 2 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2902,8 +2902,8 @@ Introspection helpers
Get the unsubscripted version of a type: for a typing object of the form
``X[Y, Z, ...]`` return ``X``. If ``X`` is a generic alias for a builtin or
:mod:`collections` class, it gets normalized to the original class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add that for ParamSpecArgs and Kwargs, it returns the underlying ParamSpec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

If ``X`` is an instance of :class:``ParamSpecArgs`` or :class:``ParamSpecKwargs``,
return the underlying :class:``ParamSpec``.
If ``X`` is an instance of :class:`ParamSpecArgs` or :class:`ParamSpecKwargs`,
return the underlying :class:`ParamSpec`.
Return ``None`` for unsupported types.
Examples::

Expand Down
0