Python builtin overwrites (cpmpy.expressions.python_builtins
)
Overwrites a number of python built-ins, so that they work over variables as expected.
List of functions
all() overwrites python built-in, if iterable contains an Expression, then returns an Operator("and", iterable) otherwise returns whether all of the arguments is true |
|
any() overwrites python built-in, if iterable contains an Expression, then returns an Operator("or", iterable) otherwise returns whether any of the arguments is true |
|
max() overwrites python built-in, checks if all constants and computes np.max() in that case |
|
min() overwrites python built-in, checks if all constants and computes np.min() in that case |
|
sum() overwrites python built-in, checks if all constants and computes np.sum() in that case otherwise, makes a sum Operator directly on iterable |
- cpmpy.expressions.python_builtins.all(iterable)[source]
all() overwrites python built-in, if iterable contains an Expression, then returns an Operator(“and”, iterable) otherwise returns whether all of the arguments is true
- cpmpy.expressions.python_builtins.any(iterable)[source]
any() overwrites python built-in, if iterable contains an Expression, then returns an Operator(“or”, iterable) otherwise returns whether any of the arguments is true
- cpmpy.expressions.python_builtins.max(iterable)[source]
max() overwrites python built-in, checks if all constants and computes np.max() in that case