yera.typing.utils

Helpers for the app module's typing infrastructure.

Symbols

def derive_type — Derive a supported Yera type hint from a runtime value.
def get_type_name — Render a type hint as a human-readable string.

derive_type

derive_type(
    value: object,
) → type

Derive a supported Yera type hint from a runtime value.

Parameters

value
type: object

A runtime value accepted by Yera's typing system.

Returns

type: type

A concrete or recursively parameterized supported Yera type.

Raises

TypeError

If the value is unsupported or its type is under-specified.

get_type_name

get_type_name(
    type_hint: type,
) → str

Render a type hint as a human-readable string.

Parameters

type_hint
type: type

the type hint to convert.

Returns

type: str

str representing the type.