View on GitHub

mypy_boto3

Type annotations for boto3 compatible with mypy, VSCode and PyCharm

Download this project as a .zip file Download this project as a tar.gz file

TypeLiteral

Auto-generated documentation for builder.mypy_boto3_builder.type_annotations.type_literal module.

Wrapper for typing/typing_extensions.Literal type annotations like Literal['a', 'b']

TypeLiteral

[find in source code]

class TypeLiteral(FakeAnnotation):
    def __init__(*children: Any) -> None:

Wrapper for typing/typing_extensions.Literal type annotations like Literal['a', 'b']

Arguments

TypeLiteral().add_child

[find in source code]

def add_child(child: FakeAnnotation) -> None:

TypeLiteral().add_literal_child

[find in source code]

def add_literal_child(child: Any) -> None:

Add new child to TypeLiteral annotation.

TypeLiteral().copy

[find in source code]

def copy() -> 'TypeLiteral':

Create a copy of type annotation wrapper.

TypeLiteral.get_import_record

[find in source code]

@staticmethod
def get_import_record() -> ImportRecord:

Get import record required for using type annotation.

TypeLiteral().is_literal

[find in source code]

def is_literal() -> bool:

Whether type annotation is Literal.

TypeLiteral().render

[find in source code]

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

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

Returns

A string with a valid type annotation.