diff options
| author | Bas van Beek <b.f.van.beek@vu.nl> | 2020-11-25 14:14:44 +0100 |
|---|---|---|
| committer | Bas van Beek <b.f.van.beek@vu.nl> | 2020-11-25 14:14:44 +0100 |
| commit | 107b2e876b179a4d99836d48f90aa512b1fd8838 (patch) | |
| tree | 419353e1b210542f74f26b326e32d1eb777b0b52 | |
| parent | e38a64fd8d78d838f950db685a16337aa78f9940 (diff) | |
| download | numpy-107b2e876b179a4d99836d48f90aa512b1fd8838.tar.gz | |
MAINT: Add `__all__` to `numpy.typing`
| -rw-r--r-- | numpy/typing/__init__.py | 12 |
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, |
