Strong article here, accept claps!
Typed Python codebases have gone from being a curiosity to being standard in just a few years. I personally moved toward typing all my libraries, due to demand, and it's been very useful.
There are still some unresolved details in Python's typing. If you are writing decorators, something almost all of the frameworks and libraries you discussed use, you can't get away from *args
and **kwargs
.
Things like typing.TypedDict
are helping to close the gap, but it can still be very hard to write correctly typed decorators — I have one of my projects, dtyper
, where several smart people and me as well have struggled to get all the typing right and we failed, though admittedly constructing dataclasses
on the fly is somewhat obscure.
But we'll work it out, and typing
is just so useful in 2023 I can't imagine starting a new project without it.