TypeAnnotation#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Type Annotations / TypeAnnotation
Auto-generated documentation for mypy_boto3_builder.type_annotations.type_annotation module.
TypeAnnotation#
Show source in type_annotation.py:14
Attributes#
-
SUPPORTED_TYPES
:dict[str, ImportString]
- Set of supported type annotations. value is default import module: {'Union': _typing, 'Any': _typing, 'Dict': _typing, 'List': _typing, 'Set': _typing, 'Optional': _typing, 'IO': _typing, 'overload': _typing, 'Type': _typing, 'NoReturn': _typing, 'TypedDict': _typing, 'Literal': _typing, 'Mapping': _typing, 'Sequence': _typing, 'Callable': _typing, 'Iterator': _typing, 'Awaitable': _typing, 'AsyncIterator': _typing, 'NotRequired': _typing} -
FALLBACK
:dict[str, tuple[tuple[int, int] | None, ImportString]]
- Set of fallback type annotations: {'NotRequired': ((3, 12), _typing_extensions), 'TypedDict': ((3, 12), _typing_extensions), 'Literal': ((3, 12), _typing_extensions)}
Wrapper for typing
type annotation.
Arguments#
wrapped_type
- Original type annotation as a string.
Signature#
See also#
TypeAnnotation().copy#
Show source in type_annotation.py:114
Create a copy of type annotation wrapper.
Signature#
TypeAnnotation()._get_import_records#
Show source in type_annotation.py:76
Create a safe Import Record for annotation.
Signature#
See also#
TypeAnnotation().get_import_name#
Show source in type_annotation.py:70
Create a safe name for imported annotation.
Signature#
TypeAnnotation().is_dict#
Show source in type_annotation.py:96
Whether annotation is a plain Dict.
Signature#
TypeAnnotation().is_list#
Show source in type_annotation.py:102
Whether annotation is a plain List.
Signature#
TypeAnnotation().is_union#
Show source in type_annotation.py:108
Whether annotation is a Union.
Signature#
TypeAnnotation().render#
Show source in type_annotation.py:61
Render type annotation to a valid Python code for local usage.
Returns#
A string with a valid type annotation.