We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
count_nonzero
1 parent bc2b042 commit 87b6389Copy full SHA for 87b6389
numpy/_core/numeric.pyi
@@ -431,7 +431,7 @@ def count_nonzero(
431
axis: None = ...,
432
*,
433
keepdims: L[False] = ...,
434
-) -> int: ...
+) -> intp: ...
435
@overload
436
def count_nonzero(
437
a: ArrayLike,
numpy/typing/tests/data/reveal/numeric.pyi
@@ -27,9 +27,9 @@ AR_O: npt.NDArray[np.object_]
27
B: list[int]
28
C: SubClass
29
30
-assert_type(np.count_nonzero(i8), int)
31
-assert_type(np.count_nonzero(AR_i8), int)
32
-assert_type(np.count_nonzero(B), int)
+assert_type(np.count_nonzero(i8), np.intp)
+assert_type(np.count_nonzero(AR_i8), np.intp)
+assert_type(np.count_nonzero(B), np.intp)
33
assert_type(np.count_nonzero(AR_i8, keepdims=True), Any)
34
assert_type(np.count_nonzero(AR_i8, axis=0), Any)
35
0 commit comments