__init__.py marks a directory as a regular Python package and gets executed the first time that package is imported.
What it actually does
When you import users (or anything under it), Python:
1Sees the directory contains __init__.py → treats it as a regular package (not a namespace package).
2Implicitly runs the code in that file.
3Binds whatever the file defines (functions, variables, imports, __all__) into the package’s namespace.
In the screenshot you linked, the file has:
__all__ = ["service", "models"]
That’s the classic use: controlling what from users import * pulls in, and often re-exporting submodules so people can do from users import service instead of from users.service import ....
It can also hold package-level setup code, version constants, convenience imports, etc.
What happens if you delete it
Since Python 3.3 (PEP 420) it does not immediately break everything.
•The directory becomes an implicit namespace package.
•Submodule imports (import users.service) often still work.
•But any code that was in __init__.py disappears → re-exports, __all__, initialization, and package-level attributes vanish.
•Some tools (mypy, older pytest setups, certain IDEs, packaging tools) still expect the file and can get confused.
•Regular packages are slightly faster to import than namespace packages.
•Pre-3.3 Python would just fail the import with ImportError.
Source / deep dive links
•Official docs (regular vs namespace packages): https://t.co/tMUmPWxk6a
•PEP 420 (the change that made __init__.py optional): https://t.co/XwSb5PHcjs
•CPython import machinery source: https://t.co/0Xw5KPzwYC and the high-level import reference in https://t.co/wBbChdkC0F
•Classic Stack Overflow thread: https://t.co/SJi99nKaQM
Bottom line: Keep the empty __init__.py for normal packages unless you deliberately want a namespace package (split across multiple directories). Deleting it turns the folder into a different kind of package and silently drops any initialization or re-export logic that was living in the file.
It’s heartbreaking to see some freedom fighters from a particular ብሄር killing their own people and looting the very communities they claim to fight for.
At the end of the day, many who claim to fight for freedom are often more interested in money, power, and chair.
I made this fun little project. It’s basically just design types, and I made it for someone because I thought it might help them.
https://t.co/7p2yu6IBTv