summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-01-25 16:05:01 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2021-01-25 16:15:09 +0100
commitbcfb1180374a50c34e11e576efe00d5c676d9f77 (patch)
tree34b5a440cf94a30b6577fee89a3d4c0f35e4b2da
parent1dd2bd66119f73a31eb510615bfb77c193a164fa (diff)
downloadnumpy-bcfb1180374a50c34e11e576efe00d5c676d9f77.tar.gz
ENH: Add annotations for certain module-level dunders
-rw-r--r--numpy/__init__.pyi7
-rw-r--r--numpy/typing/tests/data/reveal/modules.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 4178f4951..27881a725 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -311,6 +311,13 @@ from numpy.core.shape_base import (
vstack as vstack,
)
+__all__: List[str]
+__path__: List[str]
+__version__: str
+__git_version__: str
+__NUMPY_SETUP__: bool
+__deprecated_attrs__: Dict[str, Tuple[type, str]]
+__expired_functions__: Dict[str, str]
DataSource: Any
MachAr: Any
diff --git a/numpy/typing/tests/data/reveal/modules.py b/numpy/typing/tests/data/reveal/modules.py
index 406463152..3ff44b6a7 100644
--- a/numpy/typing/tests/data/reveal/modules.py
+++ b/numpy/typing/tests/data/reveal/modules.py
@@ -18,3 +18,11 @@ reveal_type(np.version) # E: ModuleType
# TODO: Remove when annotations have been added to `np.testing.assert_equal`
reveal_type(np.testing.assert_equal) # E: Any
+
+reveal_type(np.__all__) # E: list[builtins.str]
+reveal_type(np.__path__) # E: list[builtins.str]
+reveal_type(np.__version__) # E: str
+reveal_type(np.__git_version__) # E: str
+reveal_type(np.__NUMPY_SETUP__) # E: bool
+reveal_type(np.__deprecated_attrs__) # E: dict[builtins.str, Tuple[builtins.type, builtins.str]]
+reveal_type(np.__expired_functions__) # E: dict[builtins.str, builtins.str]