Specify type of function's argument to function

Viewed 11
def function(func: function):
    func()

the code up here is an example, but i want a to speficy that the function argument has to be a python function, but the error i am getting is that the function type is not recognized.

i can't find anything coerent about this error online

i tried using typing library but i didn't nothing useful

sorry if this is difficult to read, i am not an english native so i might make some errors, any response is appreciated :)

0 Answers
Related