diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2019-09-08 11:25:57 -0700 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2019-09-19 08:57:52 +0200 |
commit | 50cbd096099d71250fa45b2d3332b0faa1341625 (patch) | |
tree | 5877b0b19e58eddfddc0b186379654b6014f6cf6 /numpy/tests/test_public_api.py | |
parent | 9996fb316d7386a0ea3b5f85e71283b3ba9abe55 (diff) | |
download | numpy-50cbd096099d71250fa45b2d3332b0faa1341625.tar.gz |
TST: add details to the public modules test about how to check public-ness
Diffstat (limited to 'numpy/tests/test_public_api.py')
-rw-r--r-- | numpy/tests/test_public_api.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py index 32e9f42d5..4d9066fc9 100644 --- a/numpy/tests/test_public_api.py +++ b/numpy/tests/test_public_api.py @@ -373,6 +373,21 @@ def test_all_modules_are_expected_2(): import .lib.scimath as emath + To check if something in a module is (effectively) public, one can check if + there's anything in that namespace that's a public function/object but is + not exposed in a higher-level namespace. For example for a `numpy.lib` + submodule:: + + mod = np.lib.mixins + for obj in mod.__all__: + if obj in np.__all__: + continue + elif obj in np.lib.__all__: + continue + + else: + print(obj) + """ modnames = [] |