pythonsyntaxnamespacespython-import

What does __all__ mean in Python?


I see __all__ in __init__.py files. What does it do?


Solution

  • It's a list of public objects of that module, as interpreted by import *. It overrides the default of hiding everything that begins with an underscore.