FakeAnnotation

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

Parent class for all type annotation wrappers.

FakeAnnotation

[find in source code]

class FakeAnnotation(ABC):

Parent class for all type annotation wrappers.

FakeAnnotation().add_child

[find in source code]

def add_child(child: _R) -> None:

Add new child to TypeSubscript or TypeTypedDict annotation.

FakeAnnotation().copy

[find in source code]

@abstractmethod
def copy() -> _R:

Create a copy of type annotation wrapper.

FakeAnnotation().get_import_record

[find in source code]

@abstractmethod
def get_import_record() -> ImportRecord:

Get import record required for using type annotation.

See also

FakeAnnotation().get_local_types

[find in source code]

def get_local_types() -> list['FakeAnnotation']:

Get internal types generated by builder.

FakeAnnotation().get_sort_key

[find in source code]

def get_sort_key() -> str:

Get string to sort annotations.

FakeAnnotation().is_dict

[find in source code]

def is_dict() -> bool:

Whether type annotation is Dict or TypedDict.

FakeAnnotation().is_list

[find in source code]

def is_list() -> bool:

Whether type annotation is List.

FakeAnnotation().is_literal

[find in source code]

def is_literal() -> bool:

Whether type annotation is Literal.

FakeAnnotation().is_typed_dict

[find in source code]

def is_typed_dict() -> bool:

Whether type annotation is TypedDict.

FakeAnnotation().iterate_types

[find in source code]

def iterate_types() -> Iterator['FakeAnnotation']:

Iterate over all used type annotations recursively including self.

FakeAnnotation().render

[find in source code]

@abstractmethod
def render(parent_name: str = '') -> str:

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