Adjust the module visibility of globals due to __all__.
(self)
| 886 | del tree.names[name] |
| 887 | |
| 888 | def adjust_public_exports(self) -> None: |
| 889 | """Adjust the module visibility of globals due to __all__.""" |
| 890 | if "__all__" in self.globals: |
| 891 | for name, g in self.globals.items(): |
| 892 | # Being included in __all__ explicitly exports and makes public. |
| 893 | if name in self.all_exports: |
| 894 | g.module_public = True |
| 895 | g.module_hidden = False |
| 896 | # But when __all__ is defined, and a symbol is not included in it, |
| 897 | # it cannot be public. |
| 898 | else: |
| 899 | g.module_public = False |
| 900 | |
| 901 | @contextmanager |
| 902 | def file_context( |
no test coverage detected