Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87b6389

Browse filesBrowse files
committed
Refine count_nonzero typing stub
1 parent bc2b042 commit 87b6389
Copy full SHA for 87b6389

File tree

Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed

‎numpy/_core/numeric.pyi

Copy file name to clipboardExpand all lines: numpy/_core/numeric.pyi
+1-1Lines 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

Copy file name to clipboardExpand all lines: numpy/typing/tests/data/reveal/numeric.pyi
+3-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.