Skip to content

Commit 87b6389

Browse files
committed
Refine count_nonzero typing stub
1 parent bc2b042 commit 87b6389

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

numpy/_core/numeric.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def count_nonzero(
431431
axis: None = ...,
432432
*,
433433
keepdims: L[False] = ...,
434-
) -> int: ...
434+
) -> intp: ...
435435
@overload
436436
def count_nonzero(
437437
a: ArrayLike,

numpy/typing/tests/data/reveal/numeric.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ AR_O: npt.NDArray[np.object_]
2727
B: list[int]
2828
C: SubClass
2929

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)
30+
assert_type(np.count_nonzero(i8), np.intp)
31+
assert_type(np.count_nonzero(AR_i8), np.intp)
32+
assert_type(np.count_nonzero(B), np.intp)
3333
assert_type(np.count_nonzero(AR_i8, keepdims=True), Any)
3434
assert_type(np.count_nonzero(AR_i8, axis=0), Any)
3535

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy