Skip to content

errors

incorrect_arity_error

incorrect_arity_error(operator: Any, expected_arity: int | str, given_arity: int) -> TypeError

Create a TypeError for incorrect operator arity.

Parameters:

Name Type Description Default
operator Any

The operator that was called

required
expected_arity int | str

Expected number of arguments (int or string like "at least 1")

required
given_arity int

Actual number of arguments provided

required

Returns:

Type Description
TypeError

TypeError instance with appropriate message