Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rustic Python

Make type-checkable Python mistakes fail static checks before execution.

Read the book

A misspelled record field, an unhandled failure, or a method called before setup can become a type-checking error. Logic and numerical correctness still need tests.

Each page covers one concept: a situation, typical Python code, a better alternative, and why it helps. Examples and their results are visible on the page. No cloning, Python installation, or terminal is needed.

The book assumes familiarity with Python functions, classes, and basic annotations. It uses Python 3.11+ and requires no Rust or machine-learning background.

Start reading

Begin with the goal and example notation. Result and match shows how a recoverable error becomes a checked outcome. Total operations applies that idea to an expected missing lookup. Then follow validated records, variants, and exhaustive matching.

Later pages cover state, protocols, external boundaries, and checker limitations.

Optional references cover agent setup, contributing, and the changelog.

Licensed under the MIT license.