17 ms·
> I would think the dumber thing is having to create an empty file called __init__.py for a package to register as a package. This hasn't been true since Pytho
by kolanos 1y ago
> I would think the dumber thing is having to create an empty file called __init__.py for a package to register as a package.
This hasn't been true since Python 3.3. You no longer need a __init__.py for Python to recognize a module, but it can still be useful in many cases.
- maleldil 1y agoThis is incorrect. > The __init__.py files are required to make Python treat directories containing the file as packages (unless using a namespace package, a relatively advanced feature). https://docs.python.org/3/tutorial/modules.html https://docs.python.org/3/tutorial/modules.html