Skip to main content

condecimal

A wrapper around Decimal that adds validation.

def condecimal(
strict: bool | None = None,
gt: int | Decimal | None = None,
ge: int | Decimal | None = None,
lt: int | Decimal | None = None,
le: int | Decimal | None = None,
multiple_of: int | Decimal | None = None,
max_digits: int | None = None,
decimal_places: int | None = None,
allow_inf_nan: bool | None = None
) - > type[Decimal]

A wrapper around Decimal that adds validation.

Parameters

NameTypeDescription
strict`boolNone` = None
gt`intDecimal
ge`intDecimal
lt`intDecimal
le`intDecimal
multiple_of`intDecimal
max_digits`intNone` = None
decimal_places`intNone` = None
allow_inf_nan`boolNone` = None

Returns

TypeDescription
type[Decimal]A Decimal type with validation constraints applied via metadata.