''' Sample.py This file contains a template to follow for creating a new operation object. The filename should the lowercase version of the class name, plus a .py extension. ''' from Condition import Operation class Sample(Operation.Operation): '''Every Operation must inherit from the base Operation class found in the operation module. The operations module contains abstract classes that can make this process easier, especially in terms of argument and return value type chekcing. At the moment these convienence classes are: NumericalOperation BooleanOperation If you choose not to have your class inherit from one of the above, be aware that the base Operation class defines the following default values: parameter_types = (object) return_type = (object) The abstract subclasses listed above overwrite any number of these values. To overwrite any of these, simply redefine them as class attributes outside any class methods (alternatively you can define them using self in the constructor). parameterTypes should be tuple representing the types for each non-keyword argument based on position. For example if you require the first argument to be an int and the second a string or list: parameter_types = (int, (str, list)) return_type should be a tuple containing any number of types that the return value of evaluate must be. ''' def evaluate(self, *args): '''The only required method to overwrite is evaluate. The args parameter should be a list of items. Returns the value of the operation. ''' # Put logic here return None