I am trying to use python3 type annotation features.
Here is some toy functions without annotation:
def fa(func, *args):
return func(*args)
def fb(x:
As the error message tells you, the name function
isn't defined. If you want to hint as a function, put it in quotes:
def fa(func: 'function', *args):
Because you define a variable in function parameters,but that parameter is not exist out of function.You have to write
fa(function="Newton")