Skip to content

Commit 38814d9

Browse files
committed
TYP: Annotate numpy.bool.__index__ and mark as deprecated
1 parent 4c11cc6 commit 38814d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numpy/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3292,7 +3292,8 @@ class bool(_RealMixin, generic):
32923292
def __init__(self, value: object = ..., /) -> None: ...
32933293
def item(self, args: L[0] | tuple[()] | tuple[L[0]] = ..., /) -> builtins.bool: ...
32943294
def tolist(self) -> builtins.bool: ...
3295-
3295+
@deprecated("In future, it will be an error for 'np.bool' scalars to be interpreted as an index")
3296+
def __index__(self, /) -> int: ...
32963297
def __abs__(self) -> Self: ...
32973298
__add__: _BoolOp[np.bool]
32983299
__radd__: _BoolOp[np.bool]

0 commit comments

Comments
 (0)