TypeSubscript

Auto-generated documentation for mypy_boto3_builder.type_annotations.type_subscript module.

Wrapper for subscript type annotations, like List[str].

TypeSubscript

[find in source code]

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.

See also

TypeSubscript().add_child

[find in source code]

def add_child(child: FakeAnnotation) -> None:

See also

TypeSubscript().copy

[find in source code]

def copy() -> 'TypeSubscript':

Create a copy of type annotation wrapper.

TypeSubscript().get_import_record

[find in source code]

def get_import_record() -> ImportRecord:

Get import record required for using type annotation.

See also

TypeSubscript().get_types

[find in source code]

def get_types() -> Set[FakeAnnotation]:

TypeSubscript().is_dict

[find in source code]

def is_dict() -> bool:

TypeSubscript().is_list

[find in source code]

def is_list() -> bool:

TypeSubscript().render

[find in source code]

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.