Description
Currently, all ufuncs are basically untyped, accepting everything and returning Any
. The numpy._typing._ufunc
type-check-only "subtypes" are hacks that somewhat ease the pain. But a better solution is needed, and numpy._typing._ufunc
should be removed entirely.
In NumPy, the .nin in {1, 2}
, and .nout <= {1, 2}
. But in SciPy (scipy.special
) has .nin in {1, 2, 3, 4, 5}
(some private ones have 7) and .nout in {1, 2, 4}
. So the numpy.ufunc
type should be flexible enough to allow nin>2
and nout>2
. See scipy/scipy-stubs#27 for details on the scipy.special
ufuncs.