python_project_template_AS.operations#
Operation container and a few example math operations.
The Operation is a tiny callable wrapper that validates arity and
delegates to the underlying function. A small set of convenience
instances (ADD, SUB, MUL, DIV, NEG, SQR) are provided for tests/examples.
Functions
|
Return the sum of two numbers. |
|
Return the product of two numbers. |
|
Return the numeric negation of a value. |
|
Divide a by b, raising |
|
Return the square of a value. |
|
Return the difference of two numbers. |
Classes
|
Named callable with arity check. |
- class python_project_template_AS.operations.Operation(name, func, arity=1)[source]#
Bases:
objectNamed callable with arity check.
- Parameters:
name (str)
func (Callable[[...], Any])
arity (int)
- name#
Operation name.
- Type:
str
- func#
Operation function.
- Type:
Callable
- arity#
Expected argument count.
- Type:
int
-
arity:
int= 1#
-
func:
Callable[...,Any]#
-
name:
str#