Python·100 questions

How are packages and __init__.py files structured?

Answer
A package is a folder with modules.
__init__.py can export public API.
Avoid heavy imports in __init__.py.
Avoid cyclic dependencies.
Keep the structure simple.
Was this answer helpful?

More questions in this topic

Related questions from other topics