Python package import patterns link + __init__ stuff
This looks really interesting! It’s not about the syntax, but about the basic design philosophies + examples of packages that use it.
What’s init for me? Designing for Python package imports | Towards Data Science
Other stuff I learned about __init__.py
:
- You can use it to enforce import order 1
- You can use it to declare package variables
- Automatically import modules from a package2
Stuff I discovered:
- You can set a breakpoint in
pdb
physically into an__init__.py
, and for example look at the stack of what called it withw
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus