Tutorial
Index
Lesson 1 - Basic Typechecking - how to make sure your functions get the right parameters and return the right things.
Lesson 2 - Built-in Types - learn about expressing complex types using Python's built-in datatypes.
Lesson 3 - Utility Classes - explore
typecheck'slibrary of utilities that allow you to make complex, precise assertions about types.Lesson 4 - Typechecking Methods - all you ever wanted to know about adding typechecking to your instance-, class- and staticmethods.
Lesson 5 - Generators - writing generators may be tricky, but typechecking them sure isn't.
Lesson 6 - Typechecking Best Practices - tips, tricks and sage counsel from the typechecking trenches.
Advanced Topics
Type Variables - all about type variables, a concept borrowed from languages like Haskell.
Doctest Support - learn how to make your typechecked code play nicely with the
doctestmodule.Using Functions for Complex Typing - in addition to the built-in utility classes, you can pass functions and methods to the typechecking decorators, allowing powerful, custom typing behaviour. Learn how.
Typechecking with assert_type - strategies for smarter, more surgical typechecking