We'll see what kind of errors mypy will throw at you, how to configure mypy
to make the best use of it, and try to figure out what its errors mean.
Why doesn't mypy show an error here?
Mypy configuration
Simple type checking examples
Using reveal_type() to debug types
Mypy types, and the typing module
Modern Python has a LOT of type checking features baked into it. In this
chapter we will see a glimpse of what the typing module has to offer.
Lists, Dictionaries, and other collections
Union and Optional types
Reading mypy error messages
Type checking your classes
Typing *args and **kwargs
The "Any" type
Diving deep into the typing module
The typing module also provides various functions and base classes, that
create the basis of a lot of concepts of mypy's type system. In this chapter
we will dive deep into these functionalities.
Static duck typing
Custom Generic types
The NamedTuple class
The TypedDict class
Function overloading with @overload
Some advanced type checking concepts
In this chapter we will learn some concepts, tips and tricks on how to
properly type-check code using some of the more complicated Python concepts.
Type checking decorators
Type checking generators
The Type type
Conclusion
In this chapter, we will wrap up the series, and understand where type
checking sits in the ecosystem of Python, and your software development
process.
Type checking, or writing tests? Why not both!
Integrating mypy into your software development lifecycle
Not Available for Preview
This lesson is not available for preview. Please join the course to access it.