2 ms·
After working in Python without type hinting for quite some time before joining a team that uses it heavily, I was pretty skeptical about how useful it would be
by rurp 5y ago
After working in Python without type hinting for quite some time before joining a team that uses it heavily, I was pretty skeptical about how useful it would be give the many rough edges I had read about. After using both approaches for a while I think that type hints are both very flawed and surprisingly useful.
Yes MyPy and type hinting in general has many limitations, rough edges, and occasionally baffling behavior. Despite all that, I think it is helpful for pretty much any Python project. Type hinting does catch a lot of potential issues and the syntax is very simple. I tend to fill in the types even on a first pass at some code since they help so much in tracking various interactions.
I think the bottom line is that something doesn't have to be great in order to be useful.