summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/typing/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py
index a9bf94f13..2dc224dd7 100644
--- a/numpy/typing/__init__.py
+++ b/numpy/typing/__init__.py
@@ -120,7 +120,7 @@ API
# NOTE: The API section will be appended with additional entries
# further down in this file
-from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, List
if TYPE_CHECKING:
import sys
@@ -131,6 +131,14 @@ if TYPE_CHECKING:
else:
def final(f): return f
+if not TYPE_CHECKING:
+ __all__ = ["ArrayLike", "DTypeLike", "NBitBase"]
+else:
+ # Ensure that all objects within this module are accessible while
+ # static type checking. This includes private ones, as we need them
+ # for internal use.
+ __all__: List[str]
+
@final # Dissallow the creation of arbitrary `NBitBase` subclasses
class NBitBase:
@@ -194,7 +202,7 @@ class _16Bit(_32Bit): ... # type: ignore[misc]
class _8Bit(_16Bit): ... # type: ignore[misc]
# Clean up the namespace
-del TYPE_CHECKING, final
+del TYPE_CHECKING, final, List
from ._scalars import (
_CharLike,