Guides
dataclasses vs Pydantic vs attrs: Which to Use
Python’s dataclasses, Pydantic, and attrs all cut class boilerplate, but only some validate data. Here’s which to reach for and why
Python Type Checkers: mypy vs Pyright vs ty vs Pyrefly
mypy, Pyright, ty, and Pyrefly all check your type hints, but they differ in maturity, speed claims, and editor support — here’s how to choose
Python Type Hints: A Practical Guide
How to actually use Python type hints beyond the basics — generics, Optional, Protocol, and when they’re worth the effort
Resources
Pyrefly
Meta’s fast Rust-based Python type checker and language server, the default checker for Instagram’s Python codebase and now at a stable 1.x release
Pyright
Microsoft’s fast, standards-based static type checker for Python — a command-line tool and VS Code extension, and the engine behind Pylance
ty
Astral’s extremely fast Rust-based Python type checker and language server, from the makers of uv and Ruff — currently in beta
mypy
Optional static type checker for Python — catches type errors before runtime by analysing type annotations, with support for gradual typing
Robust Python
Patrick Viafore’s guide to writing resilient, maintainable Python — focuses on type annotations, protocols, data classes, and designing for longevity
Strawberry GraphQL
Modern GraphQL library for Python using type hints and dataclasses — integrates with Django, FastAPI, and Flask with full async support
Typer
Build CLIs using Python type hints — automatically generates help text, shell completion, and validation with zero boilerplate, from the creator of FastAPI