TypeSubscript
Auto-generated documentation for builder.mypy_boto3_builder.type_annotations.type_subscript module.
Wrapper for subscript type annotations, like List[str]
.
- mypy-boto3 / Modules /
Builder
/ Mypy Boto3 Builder / Type Annotations / TypeSubscript
TypeSubscript
class TypeSubscript(FakeAnnotation):
def __init__(
parent: TypeAnnotation,
children: Iterable[FakeAnnotation] = (),
) -> None:
Wrapper for subscript type annotations, like List[str]
.
Arguments
parent
- Parent type annotation.children
- Children type annotations.
TypeSubscript().add_child
def add_child(child: FakeAnnotation) -> None:
TypeSubscript().copy
def copy() -> 'TypeSubscript':
Create a copy of type annotation wrapper.
TypeSubscript().get_import_record
def get_import_record() -> ImportRecord:
Get import record required for using type annotation.
TypeSubscript().get_types
def get_types() -> Set[FakeAnnotation]:
TypeSubscript().is_dict
def is_dict() -> bool:
TypeSubscript().is_list
def is_list() -> bool:
TypeSubscript().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.