TypeConstant

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

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

TypeConstant

Show source in type_constant.py:8

Wrapper for constant like False or "test".

Arguments

  • value - Constant value.

Signature

class TypeConstant(FakeAnnotation):
    def __init__(self, value: object) -> None:
        ...

See also

TypeConstant().copy

Show source in type_constant.py:37

Create a copy of type annotation wrapper.

Signature

def copy(self) -> "TypeConstant":
    ...

TypeConstant().get_import_record

Show source in type_constant.py:31

Get empty import record, because constants do not require imports.

Signature

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

See also

TypeConstant().is_none

Show source in type_constant.py:43

Whether value is None.

Signature

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

TypeConstant().render

Show source in type_constant.py:19

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