Python functions to define a class