cadrumo.domain.calculations.registry._formula_operator_contracts module

Canonical arity contracts for registry formula operators.

The registry schema and calculation runtime consume the same table so an operator cannot be accepted by the authored authority with a shape the runtime will later refuse. Leaf-kind requirements remain with the specialised runtime evaluators; this module owns the operator-wide argument-count contract only.

class FormulaOperatorArity(minimum, maximum=None)[source]

Bases: object

Inclusive argument-count bounds for one formula operator.

Parameters:
  • minimum (int)

  • maximum (int | None)

minimum: int
maximum: int | None
accepts(count)[source]

Return whether count satisfies these bounds.

Return type:

bool

Parameters:

count (int)

require_formula_operator_arity(op, count)[source]

Refuse an argument count outside the canonical contract for op.

Return type:

None

Parameters: