summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-02-15 01:32:39 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2021-03-04 12:48:50 +0100
commit376ba3a9f50397dc94b98253980de0bf0ebc0b68 (patch)
treeac2a195c642db0fffb798ca00b648e494f2616fb /numpy
parent982468e33aea84f05fd329baaceebac62245bfbc (diff)
downloadnumpy-376ba3a9f50397dc94b98253980de0bf0ebc0b68.tar.gz
MAINT: Disallow `timedelta64 % integer`-based operations
`timedelta64` does not support the `__mod__` and `__divmod__` operations with integers and booleans
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 4964dfce2..29e93526b 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -1641,7 +1641,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
@overload
def __mod__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co) -> _ArrayOrScalar[floating[Any]]: ... # type: ignore[misc]
@overload
- def __mod__(self: _ArrayTD64_co, other: _ArrayLikeTD64_co) -> _ArrayOrScalar[timedelta64]: ...
+ def __mod__(self: _ArrayTD64_co, other: _NestedSequence[_SupportsArray[dtype[timedelta64]]]) -> _ArrayOrScalar[timedelta64]: ...
@overload
def __mod__(self: _ArrayND[object_], other: Any) -> Any: ...
@overload
@@ -1663,7 +1663,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
@overload
def __rmod__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co) -> _ArrayOrScalar[floating[Any]]: ... # type: ignore[misc]
@overload
- def __rmod__(self: _ArrayTD64_co, other: _ArrayLikeTD64_co) -> _ArrayOrScalar[timedelta64]: ...
+ def __rmod__(self: _ArrayTD64_co, other: _NestedSequence[_SupportsArray[dtype[timedelta64]]]) -> _ArrayOrScalar[timedelta64]: ...
@overload
def __rmod__(self: _ArrayND[object_], other: Any) -> Any: ...
@overload
@@ -1685,7 +1685,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
@overload
def __divmod__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co) -> _2Tuple[_ArrayOrScalar[floating[Any]]]: ... # type: ignore[misc]
@overload
- def __divmod__(self: _ArrayTD64_co, other: _ArrayLikeTD64_co) -> Union[Tuple[int64, timedelta64], Tuple[_ArrayND[int64], _ArrayND[timedelta64]]]: ...
+ def __divmod__(self: _ArrayTD64_co, other: _NestedSequence[_SupportsArray[dtype[timedelta64]]]) -> Union[Tuple[int64, timedelta64], Tuple[_ArrayND[int64], _ArrayND[timedelta64]]]: ...
@overload
def __divmod__(
self: _ArrayND[Union[bool_, integer[Any], floating[Any], timedelta64]],
@@ -1703,7 +1703,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
@overload
def __rdivmod__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co) -> _2Tuple[_ArrayOrScalar[floating[Any]]]: ... # type: ignore[misc]
@overload
- def __rdivmod__(self: _ArrayTD64_co, other: _ArrayLikeTD64_co) -> Union[Tuple[int64, timedelta64], Tuple[_ArrayND[int64], _ArrayND[timedelta64]]]: ...
+ def __rdivmod__(self: _ArrayTD64_co, other: _NestedSequence[_SupportsArray[dtype[timedelta64]]]) -> Union[Tuple[int64, timedelta64], Tuple[_ArrayND[int64], _ArrayND[timedelta64]]]: ...
@overload
def __rdivmod__(
self: _ArrayND[Union[bool_, integer[Any], floating[Any], timedelta64]],