8000 gh-124269: Simplify `typing.Annotated` docs by StanFromIreland · Pull Request #130770 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124269: Simplify typing.Annotated docs #130770

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 7 commits into from
Mar 14, 2025
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
Benedikt's suggestions
  • Loading branch information
StanFromIreland committed Mar 12, 2025
commit 9abbabb787dd1d3069d763474cc89d3fe34c67f3
3 changes: 2 additions & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ These can be used as types in annotations. They all support subscription using
a1 = Annotated[int, ValueRange(3, 10), ctype("char")]
a2 = Annotated[int, ctype("char"), ValueRange(3, 10)]

assert a1 != a2 # Order matters
assert a1 != a2 # Order matters

It is up to the tool consuming the annotations to decide whether the
client is allowed to add multiple metadata elements to one annotation and how to
Expand Down Expand Up @@ -1447,6 +1447,7 @@ These can be used as types in annotations. They all support subscription using

.. doctest::

>>> from typing import Annotated, get_origin
>>> Password = Annotated[str, "secret"]
>>> Password.__origin__
<class 'str'>
Expand Down
Loading
0