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

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

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

max() overwrites python built-in, checks if all constants and computes np.max() in that case

min

min() overwrites python built-in, checks if all constants and computes np.min() in that case

sum

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

cpmpy.expressions.python_builtins.min(iterable)[source]

min() overwrites python built-in, checks if all constants and computes np.min() in that case

cpmpy.expressions.python_builtins.sum(iterable)[source]

sum() overwrites python built-in, checks if all constants and computes np.sum() in that case otherwise, makes a sum Operator directly on iterable