8000 gh-124120: Document `Annotated.__origin__` by sobolevn · Pull Request #124125 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124120: Document Annotated.__origin__ #124125

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
Sep 24, 2024
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
Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
sobolevn and AlexWaygood authored Sep 16, 2024
commit e8de2a56147a9d8c78e05a8d0cda25c3750278d3
5 changes: 3 additions & 2 deletions Doc/library/typing.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ These can be used as types in annotations. They all support subscription using
('very', 'important', 'metadata')

* At runtime, if you want to retrieve the original
type wrapped by ``Annotated``, use :attr:`!__origin__` attribute:
type wrapped by ``Annotated``, use the :attr:`!__origin__` attribute:

.. doctest::

Expand All @@ -1472,7 +1472,8 @@ These can be used as types in annotations. They all support subscription using

.. doctest::

>>> assert get_origin(Password) is Annotated
>>> get_origin(Password)
Annotated

.. seealso::

Expand Down
Loading
0