added a more general PyFunction interface as a substitute for TypeConverter