Optional type annotations started to enter Python around 3.8, and they have really improved the experience. Even if nothing enforces the annotations, the IDEs can pick them up and show them to you in all the usual places.
I used them heavily, but I still run into issues of guessing what type library functions return or expect me to pass in. Sometimes there was no answer because the authors I guess wanted to be cool and accept any type that kinda fits, or they return either this or that type based on the arguments and now I have to assert which one it is to the type linter. And then I’d still get runtime errors about failed property accesses deep in library code and have to figure out wtf they wanted me to do.
Optional type annotations started to enter Python around 3.8, and they have really improved the experience. Even if nothing enforces the annotations, the IDEs can pick them up and show them to you in all the usual places.
I used them heavily, but I still run into issues of guessing what type library functions return or expect me to pass in. Sometimes there was no answer because the authors I guess wanted to be cool and accept any type that kinda fits, or they return either this or that type based on the arguments and now I have to assert which one it is to the type linter. And then I’d still get runtime errors about failed property accesses deep in library code and have to figure out wtf they wanted me to do.