TypeConstant

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

Wrapper for constant like False or "test".

TypeConstant

[find in source code]

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

Wrapper for constant like False or "test".

Arguments

  • value - Constant value.

See also

TypeConstant().copy

[find in source code]

def copy() -> 'TypeConstant':

Create a copy of type annotation wrapper.

TypeConstant().get_import_record

[find in source code]

def get_import_record() -> ImportRecord:

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

See also

TypeConstant().is_none

[find in source code]

def is_none() -> bool:

Whether value is None.

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