We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9933822 commit d043dd6Copy full SHA for d043dd6
1 file changed
mypy/stubgen.py
@@ -1773,11 +1773,9 @@ def generate_asts_for_modules(
1773
mod.ast = res.graph[mod.module].tree
1774
# Use statically inferred __all__ if there is no runtime one.
1775
if mod.runtime_all is None:
1776
- mod.runtime_all = [
1777
- name
1778
- for name, sym in res.manager.semantic_analyzer.modules[mod.module].names.items()
1779
- if sym.module_public
1780
- ]
+ mod_names = res.manager.semantic_analyzer.modules[mod.module].names
+ if "__all__" in mod_names:
+ mod.runtime_all = [name for name, sym in mod_names.items() if sym.module_public]
1781
1782
1783
def generate_stub_for_py_module(
0 commit comments