You can use the typing module for Callable annotations.
The Callable annotation is supplied a list of argument types and a return type:
from typing import Callable
def func_b(func: Callable[[int], int]) -> int:
return func(3)
You can use the typing module for Callable annotations.
The Callable annotation is supplied a list of argument types and a return type:
from typing import Callable
def func_b(func: Callable[[int], int]) -> int:
return func(3)