minos.common.model.types.comparators

Functions

is_model_subclass(type_)

Check if the given type field is subclass of Model.

is_model_type(value_)

Check if the given type is a model instance.

is_type_subclass(type_)

Check if the given type field is subclass of type.

Classes

TypeHintComparator

Type Hint Comparator class.

is_model_subclass(type_)[source]

Check if the given type field is subclass of Model.

Parameters

type_ (type) –

Return type

bool

is_type_subclass(type_)[source]

Check if the given type field is subclass of type.

Parameters

type_ (type) –

Return type

bool

is_model_type(value_)[source]

Check if the given type is a model instance.

Parameters

value_ (type) –

class TypeHintComparator[source]

Bases: object

Type Hint Comparator class.

__init__(first, second)[source]
Parameters
  • first (T) –

  • second (K) –

match()[source]

Check if the two types match.

Returns

True if there is a match or False otherwise.

Return type

bool