It seems I can not deepcopy or pickle an object with an attribute that points to any function that is not a built in. I thought it should be ok as long as the function is defined in the top level of a module. What am I missing??