python -c
- To execute a single line or block of Python code.
- Provided as a string argument directly in the terminal, without requiring a separate script file.
__init__.py
__init__.py will treat the folder as a package (importable module).
- Hence,
from backend.models.grid import Cell can work.
- Can just empty in the file if don't need any package-level setup code.
__pycache__
- Automatically created it when run any
.py file.
- It stores compiled bytecode (
.pyc files) so Python doesn't reparse the source code every time.
- Speed optimization.
- Never touch it, never commit it to git.
.pycache__/
└── constants.cpython-312.pyc
// compiled version of constants.py
@dataclass
- Shortcut for data containers