TLDR Web Dev · MISCELLANEOUS
THE TROUBLE WITH __ALL__
Summary from the TLDR Web Dev newsletter
Python's `__all__` attribute is meant to define a module's public API, but it doesn't enforce it, allowing access to private elements. This can lead to tightly coupled modules and broken domain boundaries, especially in large projects. A custom `ModuleWrapper` class can enforce `__all__` but has downsides like runtime impact and limited scope.