Calling Functions using Default Values

As for the context of the current discussion, it was initiated after my question, quoted below, that was posed within a previous discussion, I need an expert:

For the sake of completeness, here is a simple example of references to imported function definitions as default values for function parameters:

# source of the function definitions
import math 

# function, with references to imported functions as default values for its parameters
def sum_of_function_results(val, f1=math.sin, f2=math.cos, f3=math.tan):
    return f1(val) + f2(val) + f3(val)

print(sum_of_function_results(math.pi / 4))

Output:

2.414213562373095

However, it now appears that the OP might actually be interested in typing instead. If that be the case, see:

1 Like