GeoPython 2022

Python static type checking with mypy
2022-06-20, 10:45–11:15, Room 2

Add another layer of safety to your codebase with static typing.


Python is a dynamic language, which gives its users a lot of power. But, as we know, with great power comes great responsibility. Fortunately for us, we can incorporate a tool in our workflows - Mypy. Mypy allows developers to add a layer of safety in their programs - static type annotations.

During my talk, I will show you why PEP484 type annotations can be helpful, how to check them, and gradually introduce them in your codebase. Additionally, I want to show some tricks to make the dynamic parts safer. Finally, I will also show situations where Mypy falls short and how to avoid them.