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: 'FakeAnnotation') -> None:

Add new child to TypeSubscript or TypeTypedDict annotation.

FakeAnnotation().add_literal_child

[find in source code]

def add_literal_child(child: Any) -> None:

Add new child to TypeLiteral annotation.

FakeAnnotation().copy

[find in source code]

@abstractmethod
def copy() -> 'FakeAnnotation':

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_types

[find in source code]

def get_types() -> Set['FakeAnnotation']:

Get all used type annotations recursively including self.

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().render

[find in source code]

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

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