rberga06.utils.types.annotated#
- rberga06.utils.types.annotated(*metadata: object) Callable[[_T], _T] #
A decorator that sets ‘Annotated’ metadata for a type.
- Example:
>>> @annotated(42, 69) ... class Foo: pass >>> Foo typing.Annotated[rberga06.utils.types.Foo, 42, 69] >>> from annotated_types import Gt >>> positive = annotated(Gt(0)) >>> p_int = positive(int) >>> p_int == Annotated[int, Gt(0)] True