FakeAnnotation
Auto-generated documentation for mypy_boto3_builder.type_annotations.fake_annotation module.
Parent class for all type annotation wrappers.
- mypy-boto3-builder / Modules / Mypy Boto3 Builder / Type Annotations / FakeAnnotation
- FakeAnnotation
- FakeAnnotation().add_child
- FakeAnnotation().copy
- FakeAnnotation().get_import_record
- FakeAnnotation().get_local_types
- FakeAnnotation().get_sort_key
- FakeAnnotation().is_dict
- FakeAnnotation().is_list
- FakeAnnotation().is_literal
- FakeAnnotation().is_typed_dict
- FakeAnnotation().iterate_types
- FakeAnnotation().render
- FakeAnnotation
FakeAnnotation
class FakeAnnotation(ABC):
Parent class for all type annotation wrappers.
FakeAnnotation().add_child
def add_child(child: _R) -> None:
Add new child to TypeSubscript
or TypeTypedDict
annotation.
FakeAnnotation().copy
@abstractmethod
def copy() -> _R:
Create a copy of type annotation wrapper.
FakeAnnotation().get_import_record
@abstractmethod
def get_import_record() -> ImportRecord:
Get import record required for using type annotation.
See also
FakeAnnotation().get_local_types
def get_local_types() -> list['FakeAnnotation']:
Get internal types generated by builder.
FakeAnnotation().get_sort_key
def get_sort_key() -> str:
Get string to sort annotations.
FakeAnnotation().is_dict
def is_dict() -> bool:
Whether type annotation is Dict
or TypedDict
.
FakeAnnotation().is_list
def is_list() -> bool:
Whether type annotation is List
.
FakeAnnotation().is_literal
def is_literal() -> bool:
Whether type annotation is Literal
.
FakeAnnotation().is_typed_dict
def is_typed_dict() -> bool:
Whether type annotation is TypedDict
.
FakeAnnotation().iterate_types
def iterate_types() -> Iterator['FakeAnnotation']:
Iterate over all used type annotations recursively including self.
FakeAnnotation().render
@abstractmethod
def render(parent_name: str = '') -> str:
Render type annotation to a valid Python code for local usage.