Type annotation for function returning a lambda
You can use Callable to type hint the return:
from typing import Callabledef line(slope: float, b : float) -> Callable[[float], float]: return lambda x: slope*x + b
You can use Callable to type hint the return:
from typing import Callabledef line(slope: float, b : float) -> Callable[[float], float]: return lambda x: slope*x + b