diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-03-25 09:40:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 09:40:49 -0600 |
commit | 266aad7478bc7fbcc55eea7f942a0d373b838396 (patch) | |
tree | 0f144df0739b772bf1a38b3e03463c6b4eb21d91 /numpy/typing/mypy_plugin.py | |
parent | 4115eead62a382a32afdb0450c54e0249db02915 (diff) | |
parent | 65ec64c932626689b50b53e0909ced47f5a821fa (diff) | |
download | numpy-266aad7478bc7fbcc55eea7f942a0d373b838396.tar.gz |
Merge pull request #21216 from BvB93/_typing
MAINT: Split `numpy.typing` into a public and private component
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": |