Skip to main content

conlist

A wrapper around [list][] that adds validation.

def conlist(
item_type: type[AnyItemType],
min_length: int | None = None,
max_length: int | None = None,
unique_items: bool | None = None
) - > type[list[AnyItemType]]

A wrapper around [list][] that adds validation.

Parameters

NameTypeDescription
item_typetype[AnyItemType]The type of the items in the list.
min_length`intNone` = None
max_length`intNone` = None
unique_items`boolNone` = None

Returns

TypeDescription
type[list[AnyItemType]]The wrapped list type.