I use __init__.py
to run checks when I do from myprojects.something import blabla
.
Today I started using pyzmq
and I wanted to see what's going on behind the scenes. So I browsed the code in github and I find (for me) some strange usage of __init__.py
there that I cannot explain myself.
For example zmq/core/__init__.py
. What's the point of adding in zmq.core.__all__
the __all__
's value of zmq.core.constants, zmq.core.error, zmq.core.message, etc.
?
In zmq/__init__.py
I see at the end
__all__ = ['get_includes'] + core.__all__
where get_includes
is a function which basically returns a list with the directory of the module and the utils directory in the parent directory.
What's the point of that? What has __init.py__
achieved by doing that?