Skip to content

Commit f13b485

Browse files
Benedikt's suggestions
1 parent d9ce974 commit f13b485

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/library/typing.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,11 +1376,10 @@ These can be used as types in annotations. They all support subscription using
13761376
class ctype:
13771377
kind: str
13781378

1379-
Annotated[int, ValueRange(3, 10), ctype("char")]
1379+
a1 = Annotated[int, ValueRange(3, 10), ctype("char")]
1380+
a2 = Annotated[int, ctype("char"), ValueRange(3, 10)]
13801381

1381-
assert Annotated[int, ValueRange(3, 10), ctype("char")] != Annotated[
1382-
int, ctype("char"), ValueRange(3, 10)
1383-
] # Order matters
1382+
assert a1 != a2 # Order matters
13841383

13851384
It is up to the tool consuming the annotations to decide whether the
13861385
client is allowed to add multiple metadata elements to one annotation and how to
@@ -1445,6 +1444,9 @@ These can be used as types in annotations. They all support subscription using
14451444
typing.Annotated[int, 'very', 'important', 'metadata']
14461445
>>> X.__metadata__
14471446
('very', 'important', 'metadata')
1447+
1448+
.. doctest::
1449+
14481450
>>> Password = Annotated[str, "secret"]
14491451
>>> Password.__origin__
14501452
<class 'str'>

0 commit comments

Comments
 (0)