TypeAnnotation
Auto-generated documentation for builder.mypy_boto3_builder.type_annotations.type_annotation module.
Wrapper for simple type annotation like str
or Dict
.
- mypy-boto3 / Modules /
Builder
/ Mypy Boto3 Builder / Type Annotations / TypeAnnotation
TypeAnnotation
class TypeAnnotation(FakeAnnotation):
def __init__(wrapped_type: Any) -> None:
Wrapper for simple type annotation like str
or Dict
.
Arguments
wrapped_type
- Original type annotation.
TypeAnnotation().copy
def copy() -> 'TypeAnnotation':
Create a copy of type annotation wrapper.
TypeAnnotation().get_import_name
def get_import_name() -> str:
TypeAnnotation().get_import_record
def get_import_record() -> ImportRecord:
TypeAnnotation().is_dict
def is_dict() -> bool:
TypeAnnotation().is_list
def is_list() -> bool:
TypeAnnotation().render
def render(parent_name: str = '') -> str:
Render type annotation to a valid Python code for local usage.
Returns
A string with a valid type annotation.