3 Mar
2021
3 Mar
'21
2:47 p.m.
On 3/3/21 12:55 PM, George Harding wrote:
Python has an __all__ variable that can be defined in a module to restrict which members of the module should be included in a call `from foo import *`.
The primary purpose these days for `__all__` is to codify a module's API. The *-import is just a happy accident.
However specifying which members of the module should be excluded is more difficult.
And unnecessary -- specify `__all__` so your users know which classes, functions, variables, etc., can be safely used. If it should be excluded, don't put it in `__all__`. -- ~Ethan~