Skip to content

Commit c7bcd2c

Browse files
jorenhamcharris
authored andcommitted
TYP: place: widen mask (#32926)
1 parent 8a2de01 commit c7bcd2c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎numpy/lib/_function_base_impl.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from _typeshed import ConvertibleToInt, Incomplete
1+
from _typeshed import Incomplete
22
from collections.abc import Callable, Iterable, Sequence
33
from typing import (
44
Any,
@@ -2266,7 +2266,7 @@ def meshgrid(
22662266
) -> tuple[NDArray[Any], ...]: ...
22672267

22682268
#
2269-
def place(arr: np.ndarray, mask: ConvertibleToInt | Sequence[ConvertibleToInt], vals: ArrayLike) -> None: ...
2269+
def place(arr: np.ndarray, mask: _ArrayLikeInt_co, vals: ArrayLike) -> None: ...
22702270

22712271
# keep in sync with `insert`
22722272
@overload # known scalar-type, axis=None (default)

‎numpy/typing/tests/data/reveal/lib_function_base.pyi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ assert_type(np.select([AR_b], [AR_f8]), npt.NDArray[np.float64])
129129

130130
# places
131131
assert_type(np.place(AR_f8, mask=AR_i8, vals=5.0), None)
132+
assert_type(np.place(AR_f8_2d, [[True, False], [False, True]], 0), None)
132133

133134
# copy
134135
assert_type(np.copy(AR_LIKE_f8), np.ndarray)

0 commit comments

Comments
 (0)