What is the -> symbol for returning a function from another function?
def OneFunc(x) -> def:
return AnotherFunc
Does not seem to work, nor function / func ..
What is the -> symbol for returning a function from another function?
def OneFunc(x) -> def:
return AnotherFunc
Does not seem to work, nor function / func ..
You want the Callable generic type.
from typing import Callable
def OneFunc(x: int) -> Callable[[], None]:
return lambda: AnotherFunc('5', x)
The parameters to Callable depend on the signature of the function you're returning.