aspis.internal.errors.arity_error
Exceptions
|
Custom exception for handling function arity mismatches. |
- exception aspis.internal.errors.arity_error.ArityError(e)[source]
Custom exception for handling function arity mismatches.
ArityError parses TypeError exceptions to determine if they’re caused by incorrect function arity (wrong number of arguments). It categorizes errors as under-application (too few arguments) or over-application (too many arguments), and tracks whether the error involves keyword arguments.
Example
>>> def foo(a, b): ... return a + b >>> try: ... foo(1) ... except TypeError as e: ... arity_err = ArityError(e) ... print(arity_err.underapplied) True