Functions

Functions to be used on generators

This module includes some standard functions to be used on dammy objects

dammy.functions.average(lst)

Get the average value of a list

Parameters:lst (list) – A list containing numeric values
Returns:dammy.FunctionResult
dammy.functions.call_function(obj, fun, *args, **kwargs)

Call a user given function. This function is useful when none of the available functions fulfills the task the user wants, so the user can feed the desired function here.

Parameters:
  • obj (BaseDammy) – The object on which the function will be called
  • fun (callable) – The function to call
  • args – Comma separated arguments for the function
  • kwargs – Comma separated keyword identified arguments for the function
Returns:

dammy.FunctionResult

dammy.functions.cast(obj, t)

Casts an object to the specified type

Parameters:
  • obj – The object to cast
  • t – The type
Returns:

dammy.FunctionResult

dammy.functions.maximum(lst)

Get the maximum value of a list

Parameters:lst (list) – A list containing numeric values
Returns:dammy.FunctionResult
dammy.functions.minimum(lst)

Get the minimum value of a list

Parameters:lst (list) – A list containing numeric values
Returns:dammy.FunctionResult