summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorGaëtan de Menten <gdementen@gmail.com>2021-12-06 16:11:35 +0100
committerGaëtan de Menten <gdementen@gmail.com>2022-01-10 17:27:15 +0100
commit156d8c3394ef1724034c2d9432ea9b89693d8582 (patch)
tree3007d2f946c4edef39792e647d8819ce0da87296 /numpy
parentf4a3e07877eb258f69a7d65d8a3b7e8d96e1aacd (diff)
downloadnumpy-156d8c3394ef1724034c2d9432ea9b89693d8582.tar.gz
MAINT: removed duplicate 'int' type in ScalarType
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/numerictypes.py2
-rw-r--r--numpy/core/numerictypes.pyi1
-rw-r--r--numpy/typing/tests/data/pass/numerictypes.py6
-rw-r--r--numpy/typing/tests/data/reveal/numerictypes.pyi6
4 files changed, 7 insertions, 8 deletions
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index 8e5de852b..3d1cb6fd1 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -516,7 +516,7 @@ def _scalar_type_key(typ):
return (dt.kind.lower(), dt.itemsize)
-ScalarType = [int, float, complex, int, bool, bytes, str, memoryview]
+ScalarType = [int, float, complex, bool, bytes, str, memoryview]
ScalarType += sorted(_concrete_types, key=_scalar_type_key)
ScalarType = tuple(ScalarType)
diff --git a/numpy/core/numerictypes.pyi b/numpy/core/numerictypes.pyi
index f8c49b957..09c180a0f 100644
--- a/numpy/core/numerictypes.pyi
+++ b/numpy/core/numerictypes.pyi
@@ -137,7 +137,6 @@ ScalarType: tuple[
type[int],
type[float],
type[complex],
- type[int],
type[bool],
type[bytes],
type[str],
diff --git a/numpy/typing/tests/data/pass/numerictypes.py b/numpy/typing/tests/data/pass/numerictypes.py
index 5af0d171c..7f1dd0945 100644
--- a/numpy/typing/tests/data/pass/numerictypes.py
+++ b/numpy/typing/tests/data/pass/numerictypes.py
@@ -38,9 +38,9 @@ np.nbytes[np.int64]
np.ScalarType
np.ScalarType[0]
-np.ScalarType[4]
-np.ScalarType[9]
-np.ScalarType[11]
+np.ScalarType[3]
+np.ScalarType[8]
+np.ScalarType[10]
np.typecodes["Character"]
np.typecodes["Complex"]
diff --git a/numpy/typing/tests/data/reveal/numerictypes.pyi b/numpy/typing/tests/data/reveal/numerictypes.pyi
index cc2335264..e1857557d 100644
--- a/numpy/typing/tests/data/reveal/numerictypes.pyi
+++ b/numpy/typing/tests/data/reveal/numerictypes.pyi
@@ -33,9 +33,9 @@ reveal_type(np.nbytes[np.int64]) # E: int
reveal_type(np.ScalarType) # E: Tuple
reveal_type(np.ScalarType[0]) # E: Type[builtins.int]
-reveal_type(np.ScalarType[4]) # E: Type[builtins.bool]
-reveal_type(np.ScalarType[9]) # E: Type[{csingle}]
-reveal_type(np.ScalarType[11]) # E: Type[{clongdouble}]
+reveal_type(np.ScalarType[3]) # E: Type[builtins.bool]
+reveal_type(np.ScalarType[8]) # E: Type[{csingle}]
+reveal_type(np.ScalarType[10]) # E: Type[{clongdouble}]
reveal_type(np.typecodes["Character"]) # E: Literal['c']
reveal_type(np.typecodes["Complex"]) # E: Literal['FDG']