Context
Assume a function taking in a function like this:
def some_func(
parameter_1: str
, func: function
):
pass
As can be seen func shall be a function passed to some_func.
Anyhow, func shall be a function taking in a specifc parameter-type:
def func(
specific_parameter_of_type_string: str
):
pass
Question
How do I declare in some_func() that the parameter func shall be a function which takes in a str?
I looked into the typing-module but did not find the solution to my question. Anyhow, I think it should be solvable with it...
The result would resemble something like this I assume:
import typing
def some_func(
parameter_1: str
, func: typing.Function[str] # Example! This does not exist in typing
):
pass
funcshall be a function taking in a specifc parameter-type"Callable?