diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2022-03-18 17:09:56 +0100 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2022-03-18 18:29:54 +0100 |
commit | 7739583f5fb39c31e83010a3153fa078004e55eb (patch) | |
tree | 23435d5de3f1870bc664354d50524b7166c2587a /numpy/typing/mypy_plugin.py | |
parent | a8f9711493adee93fa3d61e7ef1bee11d7055a85 (diff) | |
download | numpy-7739583f5fb39c31e83010a3153fa078004e55eb.tar.gz |
MAINT: Split `numpy.typing` into a public and private component
i.e. `numpy.typing` and `numpy._typing`
Diffstat (limited to 'numpy/typing/mypy_plugin.py')
-rw-r--r-- | numpy/typing/mypy_plugin.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/typing/mypy_plugin.py b/numpy/typing/mypy_plugin.py index 5ac75f94d..1ffe74fa9 100644 --- a/numpy/typing/mypy_plugin.py +++ b/numpy/typing/mypy_plugin.py @@ -70,7 +70,7 @@ def _get_precision_dict() -> dict[str, str]: ret = {} for name, typ in names: n: int = 8 * typ().dtype.itemsize - ret[f'numpy.typing._nbit.{name}'] = f"numpy._{n}Bit" + ret[f'numpy._typing._nbit.{name}'] = f"numpy._{n}Bit" return ret @@ -106,7 +106,7 @@ def _get_c_intp_name() -> str: return "c_long" -#: A dictionary mapping type-aliases in `numpy.typing._nbit` to +#: A dictionary mapping type-aliases in `numpy._typing._nbit` to #: concrete `numpy.typing.NBitBase` subclasses. _PRECISION_DICT: Final = _get_precision_dict() @@ -121,7 +121,7 @@ def _hook(ctx: AnalyzeTypeContext) -> Type: """Replace a type-alias with a concrete ``NBitBase`` subclass.""" typ, _, api = ctx name = typ.name.split(".")[-1] - name_new = _PRECISION_DICT[f"numpy.typing._nbit.{name}"] + name_new = _PRECISION_DICT[f"numpy._typing._nbit.{name}"] return api.named_type(name_new) @@ -177,7 +177,7 @@ if TYPE_CHECKING or MYPY_EX is None: if file.fullname == "numpy": _override_imports( - file, "numpy.typing._extended_precision", + file, "numpy._typing._extended_precision", imports=[(v, v) for v in _EXTENDED_PRECISION_LIST], ) elif file.fullname == "numpy.ctypeslib": |