diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2022-05-14 14:50:22 +0200 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2022-05-14 14:50:22 +0200 |
commit | e7f77f30c5c894d5f85712a862ffbfbf8a3f7595 (patch) | |
tree | 5ac8f82880bff1b6cce9011e0e1e8550db23cdf2 /numpy/typing | |
parent | fd45ab90e9ce6f6724a57f215592fd3066a7436c (diff) | |
download | numpy-e7f77f30c5c894d5f85712a862ffbfbf8a3f7595.tar.gz |
TYP: Add basic `np.number` overloads for ndarray dunders
Diffstat (limited to 'numpy/typing')
-rw-r--r-- | numpy/typing/tests/data/reveal/arithmetic.pyi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/typing/tests/data/reveal/arithmetic.pyi b/numpy/typing/tests/data/reveal/arithmetic.pyi index a7077fcce..0ca5e9772 100644 --- a/numpy/typing/tests/data/reveal/arithmetic.pyi +++ b/numpy/typing/tests/data/reveal/arithmetic.pyi @@ -1,7 +1,7 @@ from typing import Any import numpy as np -from numpy._typing import _128Bit +from numpy._typing import NDArray, _128Bit # Can't directly import `np.float128` as it is not available on all platforms f16: np.floating[_128Bit] @@ -34,6 +34,7 @@ AR_c: np.ndarray[Any, np.dtype[np.complex128]] AR_m: np.ndarray[Any, np.dtype[np.timedelta64]] AR_M: np.ndarray[Any, np.dtype[np.datetime64]] AR_O: np.ndarray[Any, np.dtype[np.object_]] +AR_number: NDArray[np.number[Any]] AR_LIKE_b: list[bool] AR_LIKE_u: list[np.uint32] @@ -46,6 +47,8 @@ AR_LIKE_O: list[np.object_] # Array subtraction +reveal_type(AR_number - AR_number) # E: ndarray[Any, dtype[number[Any]]] + reveal_type(AR_b - AR_LIKE_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] reveal_type(AR_b - AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] reveal_type(AR_b - AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] |