#Typing

3 posts

Modern Python Advanced #6: Advanced typing — Variance, ParamSpec, Self, overload
4 min read

Modern Python Advanced #6: Advanced typing — Variance, ParamSpec, Self, overload

Next step from intermediate typing — covariance/contravariance, ParamSpec and Concatenate, Self, TypeGuard/TypeIs, and @overload.

Modern Python Intermediate #2: typing in earnest — Generic, Protocol, TypedDict, Literal
4 min read

Modern Python Intermediate #2: typing in earnest — Generic, Protocol, TypedDict, Literal

The next step from basics type hints — Generic for parameterizing types, Protocol for precise duck typing, TypedDict for dict shapes, and Literal for narrow unions.

Modern Python Basics #2: Variables, basic types, and type hints
4 min read

Modern Python Basics #2: Variables, basic types, and type hints

Python is a dynamic language, but modern Python writes types from the start. int/str/bool/None and built-in generics, the int | None shortcut, and mypy/pyright.