TL;DR - Mypy is amazing, but your code needs to be ready for it. The untyped nature of Python allows magic to happen and shortcuts to be made (at the cost of more runtime errors). Adding a type checker such as Mypy to a codebase developed under this ...

Markdown supported · ⌘↵ to post
Attila Gulyas
Very interesting!
I have started to massively use type hints in 2023 (after almost 11 years of coding with Python). I couldn't agree more with these 2 sentences:
a Python project should be developed with type checks in mind from the start
and:
I can't help but feel the types revolution will drastically change how we code in Python
I am still using the integrated feature of PyCharm for checking type hints. I haven't tried MyPy yet, but I will try one day!
This is great writing: It's
To think that I almost gave up my research before stumbling upon this article.. Thank you!
(Thank you also for saving us at least a month! Inherited a legacy (undocumented) Django 2 project running in production, and bringing it up to date took almost 2 weeks, so we were thinking about adding static type checking. After reading your thorough write-up though, I think we should be happy that the upgrade and subsequent migration went well..:)