TypeSubscript

mypy-boto3-builder Index / Mypy Boto3 Builder / Type Annotations / TypeSubscript

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

TypeSubscript

Show source in type_subscript.py:11

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

Arguments

  • parent - Parent type annotation.
  • children - Children type annotations.

Signature

class TypeSubscript(FakeAnnotation):
    def __init__(
        self, parent: FakeAnnotation, children: Iterable[FakeAnnotation] = ()
    ) -> None:
        ...

See also

TypeSubscript().add_child

Show source in type_subscript.py:58

Add new child to Substcript.

Signature

def add_child(self, child: FakeAnnotation) -> None:
    ...

See also

TypeSubscript().copy

Show source in type_subscript.py:76

Create a copy of type annotation wrapper.

Signature

def copy(self) -> "TypeSubscript":
    ...

TypeSubscript().get_import_record

Show source in type_subscript.py:44

Get import record required for using type annotation.

Signature

def get_import_record(self) -> ImportRecord:
    ...

See also

TypeSubscript().get_local_types

Show source in type_subscript.py:82

Get internal types generated by builder.

Signature

def get_local_types(self) -> list[FakeAnnotation]:
    ...

See also

TypeSubscript().is_dict

Show source in type_subscript.py:64

Whether subscript parent is Dict.

Signature

def is_dict(self) -> bool:
    ...

TypeSubscript().is_list

Show source in type_subscript.py:70

Whether subscript parent is List.

Signature

def is_list(self) -> bool:
    ...

TypeSubscript().iterate_types

Show source in type_subscript.py:50

Extract type annotations from children.

Signature

def iterate_types(self) -> Iterator[FakeAnnotation]:
    ...

See also

TypeSubscript().render

Show source in type_subscript.py:31

Render type annotation to a valid Python code for local usage.

Returns

A string with a valid type annotation.

Signature

def render(self, parent_name: str = "") -> str:
    ...