8000 Merge pull request #19311 from BvB93/notimplemented · numpy/numpy@209cca9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 209cca9

Browse files
authored
Merge pull request #19311 from BvB93/notimplemented
REV,BUG: Replace `NotImplemented` with `typing.Any`
2 parents 1cfefdf + 4ebcc2b commit 209cca9

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

numpy/typing/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
# NOTE: The API section will be appended with additional entries
162162
# further down in this file
163163

164-
from typing import TYPE_CHECKING, List
164+
from typing import TYPE_CHECKING, List, Any
165165

166166
if TYPE_CHECKING:
167167
import sys
@@ -364,14 +364,14 @@ class _8Bit(_16Bit): ... # type: ignore[misc]
364364
_GUFunc_Nin2_Nout1,
365365
)
366366
else:
367-
_UFunc_Nin1_Nout1 = NotImplemented
368-
_UFunc_Nin2_Nout1 = NotImplemented
369-
_UFunc_Nin1_Nout2 = NotImplemented
370-
_UFunc_Nin2_Nout2 = NotImplemented
371-
_GUFunc_Nin2_Nout1 = NotImplemented
367+
_UFunc_Nin1_Nout1 = Any
368+
_UFunc_Nin2_Nout1 = Any
369+
_UFunc_Nin1_Nout2 = Any
370+
_UFunc_Nin2_Nout2 = Any
371+
_GUFunc_Nin2_Nout1 = Any
372372

373373
# Clean up the namespace
374-
del TYPE_CHECKING, final, List
374+
del TYPE_CHECKING, final, List, Any
375375

376376
if __doc__ is not None:
377377
from ._add_docstring import _docstrings

numpy/typing/_extended_precision.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
that they can be imported conditionally via the numpy's mypy plugin.
55
"""
66

7-
from typing import TYPE_CHECKING
7+
from typing import TYPE_CHECKING, Any
88

99
import numpy as np
1010
from . import (
@@ -28,15 +28,15 @@
2828
complex256 = np.complexfloating[_128Bit, _128Bit]
2929
complex512 = np.complexfloating[_256Bit, _256Bit]
3030
else:
31-
uint128 = NotImplemented
32-
uint256 = NotImplemented
33-
int128 = NotImplemented
34-
int256 = NotImplemented
35-
float80 = NotImplemented
36-
float96 = NotImplemented
37-
float128 = NotImplemented
38-
float256 = NotImplemented
39-
complex160 = NotImplemented
40-
complex192 = NotImplemented
41-
complex256 = NotImplemented
42-
complex512 = NotImplemented
31+
uint128 = Any
32+
uint256 = Any
33+
int128 = Any
34+
int256 = Any
35+
float80 = Any
36+
float96 = Any
37+
float128 = Any
38+
float256 = Any
39+
complex160 = Any
40+
complex192 = Any
41+
complex256 = Any
42+
complex512 = Any

numpy/typing/_shape.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import sys
2-
from typing import Sequence, Tuple, Union
2+
from typing import Sequence, Tuple, Union, Any
33

44
if sys.version_info >= (3, 8):
55
from typing import SupportsIndex
66
else:
77
try:
88
from typing_extensions import SupportsIndex
99
except ImportError:
10-
Supports 8000 Index = NotImplemented
10+
SupportsIndex = Any
1111

1212
_Shape = Tuple[int, ...]
1313

numpy/typing/tests/test_generic_alias.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))
2222
FuncType = Callable[[Union[_GenericAlias, types.GenericAlias]], Any]
2323
else:
24-
DType_ref = NotImplemented
25-
NDArray_ref = NotImplemented
24+
DType_ref = Any
25+
NDArray_ref = Any
2626
FuncType = Callable[[_GenericAlias], Any]
2727

2828
GETATTR_NAMES = sorted(set(dir(np.ndarray)) - _GenericAlias._ATTR_EXCEPTIONS)

0 commit comments

Comments
 (0)
0