When I started to add type hints to existing code and I could not believe how many errors I found BEFORE running the code!

Type Hints in Python are the new pair programming.

For the longest time, I thought that type hints were verbose and added no value to my Python programs. Why should you clutter your code with something that isn’t even enforced by the Python interpretor? But then I started to add type hints to existing code and I could not believe how many errors I found BEFORE running the code! In this video, you see why a static type checker works as a pair programmer, who looks over you shoulder and points out problems before running the code.

Written by Loek van den Ouweland on 2024-02-25.
Questions regarding this artice? You can send them to the address below.