File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1433,18 +1433,20 @@ These can be used as types in annotations. They all support subscription using
14331433 {'x': typing.Annotated[int, 'metadata'], 'return': <class 'NoneType'>}
14341434
14351435 At runtime, the metadata associated with an ``Annotated `` type can be
1436- retrieved via the :attr: `!__metadata__ ` attribute. If you want to retrieve
1437- the original type wrapped by ``Annotated ``, use the :attr: `!__origin__ ` attribute:
1436+ retrieved via the :attr: `!__metadata__ ` attribute.
14381437
14391438 .. doctest ::
14401439
1441- >>> from typing import Annotated, get_origin
1440+ >>> from typing import Annotated
14421441 >>> X = Annotated[int , " very" , " important" , " metadata" ]
14431442 >>> X
14441443 typing.Annotated[int, 'very', 'important', 'metadata']
14451444 >>> X.__metadata__
14461445 ('very', 'important', 'metadata')
14471446
1447+ If you want to retrieve the original type wrapped by ``Annotated ``, use the
1448+ :attr: `!__origin__ ` attribute:
1449+
14481450 .. doctest ::
14491451
14501452 >>> from typing import Annotated, get_origin
You can’t perform that action at this time.
0 commit comments