I have a function that looks as following:
import numpy as np
def test() -> None:
a = map(np.radians, (1.,2.,np.array([1,2,3])))
Evaluating this with mypy returns the error message
error: Argument 1 to "map" has incompatible type "ufunc"; expected "Callable[[object], Any]"
Using only floats or only arrays as the input list for map
poses no problem here, the issue arises when the input list/tuple contains objects of both types. At runtime this poses no problem either.
How can I modify this function to satisfy mypy's requirements and make it typesafe?