I have a function which accepts any function such that:
- it accepts any number of arguments of type
str
- it may accept any number of keyword arguments of any type
- it returns
str
Examples of acceptable function:
def func(a: str, b: str, c: str, *, foo: int) -> str
def func(a: str, b: str, *, foo: int) -> str
def func(a: str) -> str
Examples of non-acceptable functions:
def func(a: str, b: str, c: str, foo: int) -> str
def func(foo: int) -> str
How can I type this so mypy
will accept it?
I’ve tried Callable[[str, ...], str]
but mypy already rejects that, and I don’t know how to add in the “kwargs of any type” part