Luke Lee

Software Engineer

Web + Desktop + Science

Fork me on Github

Using init.py to enforce import order

Take a few minutes on your Friday to read this article on simple rules for building great Python packages.

It's never dawned on me the usefulness of using __init__.py to enforce the import order of submodules. You might be able to even use this tactic to avoid circular dependencies in a cleaner way than imports inside functions, etc.

Published: 06-26-2015 10:44:00

lukelee.net