TypeAnnotation

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

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

TypeAnnotation

Show source in type_annotation.py:13

Wrapper for typing type annotation.

Arguments

  • wrapped_type - Original type annotation as a string.

Signature

class TypeAnnotation(FakeAnnotation):
    def __init__(self, wrapped_type: str) -> None:
        ...

See also

TypeAnnotation().copy

Show source in type_annotation.py:106

Create a copy of type annotation wrapper.

Signature

def copy(self: _R) -> _R:
    ...

TypeAnnotation().get_import_name

Show source in type_annotation.py:61

Create a safe name for imported annotation.

Signature

def get_import_name(self) -> str:
    ...

TypeAnnotation().get_import_record

Show source in type_annotation.py:67

Create a safe Import Record for annotation.

Signature

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

See also

TypeAnnotation().has_fallback

Show source in type_annotation.py:112

Whether type should be imported from typing_extensions as a py37 fallback.

Signature

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

TypeAnnotation().is_dict

Show source in type_annotation.py:88

Whether annotation is a plain Dict.

Signature

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

TypeAnnotation().is_list

Show source in type_annotation.py:94

Whether annotation is a plain List.

Signature

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

TypeAnnotation().is_union

Show source in type_annotation.py:100

Whether annotation is a Union.

Signature

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

TypeAnnotation().render

Show source in type_annotation.py:52

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:
    ...