First page Back Continue Last page Overview Graphics

Varying Numbers of Parameters

The following example show how to deal with type and arity morphism:

class NN:

def abc(self, *args):

if len(args) == 1:

if type(args[0]) == int:

pass

elif type(args[0]) == float:

pass

elif len(args) == 2:

pass

else:

pass