Best practices
Habits experienced Python teams agree on.
PEP 8 with an automatic formatter
Ruff (lint + format) or Black keep style consistent.
Type-hint public code
Run mypy or pyright in CI; hints double as documentation.
One virtual environment per project
Pin dependencies in pyproject.toml plus a lock file.
pytest for tests
Plain assert statements, fixtures and parametrisation.
Prefer the standard library
pathlib, dataclasses, itertools, functools and collections solve many problems already.
Saved in this browser only. Part of Clean code foundations (0/5).