Replies: 1 comment
-
If we are looking for the best reproducibility, and also if we are interfacing with compiled C or C++ that uses |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using mypy with NumPy 2.x, stricter type definitions are necessary. For example, functions that return an array from
np.linspace
often produce anNDArray
with dtypenp.floating[Any]
. This becomes an issue when the function signature specifies a return type like-> npt.NDArray[np.float64]
, as it causes a type error.Should we relax the type hint to allow any floating-point type (e.g., converting everything to
np.floating[Any]
or using a defined alias), or should we enforce strict adherence tonp.float64
?Beta Was this translation helpful? Give feedback.
All reactions