Notes

Source: 📖 Effective Python item 85


Making a public API

To make a public API, you must import any names that you wish to make public into the __init__.py module in the package that will be released, and add each name to the __all__ attribute.


# __init__.py
__all__ = []
from my_package import *

__all__ += my_package.__all__

See also: