summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2020-10-19 16:03:18 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-01-16 02:22:26 +0100
commitc6fc6884d3c9bc68872a7adaae2974143a910eac (patch)
treeed8438c91d97295b20a770cf9978daef41830be7
parent5c7002926ec8ad12785b36024f9da80b7017ad1c (diff)
downloadnumpy-c6fc6884d3c9bc68872a7adaae2974143a910eac.tar.gz
DEP: Formally deprecate the use of `typeDict`
`typeDict` is a deprecated alias for `sctypeDict` and has been so for >= 14 years (https://github.com/numpy/numpy/commit/668950285c407593a368336ff2e737c5da84af7d)
-rw-r--r--numpy/__init__.py4
-rw-r--r--numpy/__init__.pyi1
-rw-r--r--numpy/core/numerictypes.py2
-rw-r--r--numpy/core/numerictypes.pyi2
-rwxr-xr-xtools/functions_missing_types.py1
5 files changed, 7 insertions, 3 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index a242bb7df..a0c9a44bc 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -192,6 +192,10 @@ else:
)
for n, n2 in [("long", "int"), ("unicode", "str")]
})
+ __deprecated_attrs__["typeDict"] = (
+ getattr(core.numerictypes, "typeDict"),
+ "`np.typeDict` is a deprecated alias for `np.sctypeDict`."
+ )
from .core import round, abs, max, min
# now that numpy modules are imported, can initialize limits
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 656048173..a26b70af8 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -558,7 +558,6 @@ trim_zeros: Any
triu: Any
triu_indices: Any
triu_indices_from: Any
-typeDict: Any
typecodes: Any
typename: Any
union1d: Any
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index e705dd3ea..5a9c50ee3 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -91,7 +91,7 @@ from numpy.core.multiarray import (
from numpy.core.overrides import set_module
# we add more at the bottom
-__all__ = ['sctypeDict', 'typeDict', 'sctypes',
+__all__ = ['sctypeDict', 'sctypes',
'ScalarType', 'obj2sctype', 'cast', 'nbytes', 'sctype2char',
'maximum_sctype', 'issctype', 'typecodes', 'find_common_type',
'issubdtype', 'datetime_data', 'datetime_as_string',
diff --git a/numpy/core/numerictypes.pyi b/numpy/core/numerictypes.pyi
index 192015ff1..238495fd3 100644
--- a/numpy/core/numerictypes.pyi
+++ b/numpy/core/numerictypes.pyi
@@ -26,4 +26,4 @@ def find_common_type(
) -> dtype: ...
# TODO: Add annotations for the following objects:
-# typeDict, nbytes, cast, ScalarType & typecodes
+# nbytes, cast, ScalarType & typecodes
diff --git a/tools/functions_missing_types.py b/tools/functions_missing_types.py
index c2fe156f0..b283f5a35 100755
--- a/tools/functions_missing_types.py
+++ b/tools/functions_missing_types.py
@@ -45,6 +45,7 @@ EXCLUDE_LIST = {
"safe_eval",
"set_numeric_ops",
"test",
+ "typeDict",
# Builtins
"bool",
"complex",