summaryrefslogtreecommitdiff
path: root/numpy/typing
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2020-11-24 22:55:23 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2020-12-22 17:24:04 +0100
commit0daed8701f941945a10daf4969843a346c933baf (patch)
tree2c230fd57062b7b791a59c1ab11608cbba78bab9 /numpy/typing
parentedacfda3da401c56f1eb32d58de08581e03f84d6 (diff)
downloadnumpy-0daed8701f941945a10daf4969843a346c933baf.tar.gz
ENH: Use `intp` as return type for all appropiate functions
Since `intp` is now annotated it can be used in place of `signedinteger[Any]`
Diffstat (limited to 'numpy/typing')
-rw-r--r--numpy/typing/tests/data/reveal/fromnumeric.py24
-rw-r--r--numpy/typing/tests/data/reveal/ndarray_misc.py12
2 files changed, 18 insertions, 18 deletions
diff --git a/numpy/typing/tests/data/reveal/fromnumeric.py b/numpy/typing/tests/data/reveal/fromnumeric.py
index 2972fa1af..2d823b2e2 100644
--- a/numpy/typing/tests/data/reveal/fromnumeric.py
+++ b/numpy/typing/tests/data/reveal/fromnumeric.py
@@ -66,8 +66,8 @@ reveal_type(np.partition(c, 0, axis=None)) # E: numpy.ndarray[Any, Any]
reveal_type(np.partition(A, 0)) # E: numpy.ndarray[Any, Any]
reveal_type(np.partition(B, 0)) # E: numpy.ndarray[Any, Any]
-reveal_type(np.argpartition(a, 0)) # E: numpy.integer[Any]
-reveal_type(np.argpartition(b, 0)) # E: numpy.integer[Any]
+reveal_type(np.argpartition(a, 0)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.argpartition(b, 0)) # E: numpy.signedinteger[numpy.typing._
reveal_type(np.argpartition(c, 0)) # E: numpy.ndarray[Any, Any]
reveal_type(np.argpartition(A, 0)) # E: numpy.ndarray[Any, Any]
reveal_type(np.argpartition(B, 0)) # E: numpy.ndarray[Any, Any]
@@ -78,18 +78,18 @@ reveal_type(np.sort(B, 0)) # E: numpy.ndarray[Any, Any]
reveal_type(np.argsort(A, 0)) # E: numpy.ndarray[Any, Any]
reveal_type(np.argsort(B, 0)) # E: numpy.ndarray[Any, Any]
-reveal_type(np.argmax(A)) # E: numpy.integer[Any]
-reveal_type(np.argmax(B)) # E: numpy.integer[Any]
-reveal_type(np.argmax(A, axis=0)) # E: Union[numpy.integer[Any], numpy.ndarray[Any, Any]]
-reveal_type(np.argmax(B, axis=0)) # E: Union[numpy.integer[Any], numpy.ndarray[Any, Any]]
+reveal_type(np.argmax(A)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.argmax(B)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.argmax(A, axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
+reveal_type(np.argmax(B, axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
-reveal_type(np.argmin(A)) # E: numpy.integer[Any]
-reveal_type(np.argmin(B)) # E: numpy.integer[Any]
-reveal_type(np.argmin(A, axis=0)) # E: Union[numpy.integer[Any], numpy.ndarray[Any, Any]]
-reveal_type(np.argmin(B, axis=0)) # E: Union[numpy.integer[Any], numpy.ndarray[Any, Any]]
+reveal_type(np.argmin(A)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.argmin(B)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.argmin(A, axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
+reveal_type(np.argmin(B, axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
-reveal_type(np.searchsorted(A[0], 0)) # E: numpy.integer[Any]
-reveal_type(np.searchsorted(B[0], 0)) # E: numpy.integer[Any]
+reveal_type(np.searchsorted(A[0], 0)) # E: numpy.signedinteger[numpy.typing._
+reveal_type(np.searchsorted(B[0], 0)) # E: numpy.signedinteger[numpy.typing._
reveal_type(np.searchsorted(A[0], [0])) # E: numpy.ndarray[Any, Any]
reveal_type(np.searchsorted(B[0], [0])) # E: numpy.ndarray[Any, Any]
diff --git a/numpy/typing/tests/data/reveal/ndarray_misc.py b/numpy/typing/tests/data/reveal/ndarray_misc.py
index 3e640b3ba..df6cd4586 100644
--- a/numpy/typing/tests/data/reveal/ndarray_misc.py
+++ b/numpy/typing/tests/data/reveal/ndarray_misc.py
@@ -26,14 +26,14 @@ reveal_type(A.any(axis=0)) # E: Union[numpy.bool_, numpy.ndarray[Any, Any]]
reveal_type(A.any(keepdims=True)) # E: Union[numpy.bool_, numpy.ndarray[Any, Any]]
reveal_type(A.any(out=B)) # E: SubClass
-reveal_type(f8.argmax()) # E: numpy.signedinteger[Any]
-reveal_type(A.argmax()) # E: numpy.signedinteger[Any]
-reveal_type(A.argmax(axis=0)) # E: Union[numpy.signedinteger[Any], numpy.ndarray[Any, Any]]
+reveal_type(f8.argmax()) # E: numpy.signedinteger[numpy.typing._
+reveal_type(A.argmax()) # E: numpy.signedinteger[numpy.typing._
+reveal_type(A.argmax(axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
reveal_type(A.argmax(out=B)) # E: SubClass
-reveal_type(f8.argmin()) # E: numpy.signedinteger[Any]
-reveal_type(A.argmin()) # E: numpy.signedinteger[Any]
-reveal_type(A.argmin(axis=0)) # E: Union[numpy.signedinteger[Any], numpy.ndarray[Any, Any]]
+reveal_type(f8.argmin()) # E: numpy.signedinteger[numpy.typing._
+reveal_type(A.argmin()) # E: numpy.signedinteger[numpy.typing._
+reveal_type(A.argmin(axis=0)) # E: Union[numpy.ndarray[Any, Any], numpy.signedinteger[numpy.typing._
reveal_type(A.argmin(out=B)) # E: SubClass
reveal_type(f8.argsort()) # E: numpy.ndarray[Any, Any]