#Typing
3 posts
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.
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.
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.