minos.common.model.types.generics

Functions

unpack_typevar(value)

Unpack TypeVar into a union of possible types.

Classes

GenericTypeProjector

Generic Type Projector.

unpack_typevar(value)[source]

Unpack TypeVar into a union of possible types.

Parameters

value (TypeVar) – A type var instance.

Returns

A union of types.

Return type

type

class GenericTypeProjector[source]

Bases: object

Generic Type Projector.

__init__(type_hints, mapper)[source]
Parameters
classmethod from_model(model)[source]

Build a new instance from model.

Parameters

model (Union[Model, type[Model]]) – The model class.

Returns

A GenericTypeProjector instance.

Return type

GenericTypeProjector

build()[source]

Builder a projection of type vars values.

Returns

A dict of type hints.

Return type

dict[str, type]