Open mdpiper opened 1 year ago
I almost was able to get away without talking about this, but it's needed, in particular, for relative imports.
From the Python Tutorial:
The
__init__.py
files are required to make Python treat directories containing the file as packages. This prevents directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case,__init__.py
can just be an empty file, but it can also execute initialization code for the package...
The
__init__.py
file defines a package and lets us do relative imports. Add a paragraph on this to packaging section of the modules lesson.