Lesson 22 · Python
Professional Practice: Type Hints, Linting & Docs
Annotate functions with type hints, check your code with mypy and ruff, write Google-style docstrings, and build a README that gets a stranger from clone to running.
Prerequisites: Professional Practice: Modules, Packages & Virtual Environments
Learning objectives
By the end of this lesson, you will be able to:
- Annotate function parameters and return types, including list[str], dict[str, int] and X | None
- Explain honestly what type hints do and do not enforce at runtime
- Check a codebase with mypy and ruff, and fix what they flag
- Write Google-style docstrings for functions and classes
- Write a README that gets a stranger from clone to running