Type hints allow you to annotate function parameters and return values. While Python remains dynamically typed, hints enable static analysis tools like mypy to catch type errors before runtime.
Basic: def greet(name: str) -> str:. Modern syntax (3.10+): def process(items: list[str] | None) -> dict[str, int]:.
TypeVar and Generic allow flexible typed functions. Protocol defines structural subtyping.
Practical benefits: better IDE autocompletion, clearer function contracts, improved documentation, and easier refactoring.
Type hints are optional at runtime. Adopt them incrementally — start with public APIs and expand gradually.