O'Reilly logo
  • Chris Kang thinks this is interesting:

When module modname has an attribute named __all__, the attribute’s value is the list of the attribute names that are bound by this type of from statement.


Cover of Python in a Nutshell, 3rd Edition


If you want to restrict those attributes imported by other modules using "from xxxxx import xxxxx", you put a list of attributes you want to expose in all. These attributes are only ones that will be imported into another module.