Python 3.12 Preview: Static Typing Improvements
realpython.com
realpython.com
Fast-forward 20 years.. the pseudo-static-typing-hints are seen like panacea, and applied everywhere, without thinking how much it is useful - with pro's like "my IDE can show what the variable type is". Readability.. begone. Function signatures become horrendous lists of xxx:yyy->zzz , much resembling C++ template errors.. and you'll never notice how some default value has changed in 3rd level of passing those (2 pages of) arguments down.
so yeah.. not only code becomes spagetthi after dozen years, but also languages themselves. And python too.
I get it, I used to think this way when type hints were first introduced. I then tried them and completely embraced them.
I maintain a fairly large and old code base in Python where half the code has type hints and the other half doesn't. The half without type hints may look cleaner to read but so much harder to understand when every argument has to be inferred from context.
i have no problem with the notion of variable anotations, it is wildly useful for many things.. but sparingly.. and not for "static typing" illusion.
Python does have real strong types (so you cannot easily replace the type of some object with some other type without anyone noticing, ala (int)(void)(char)x stuff.. but that's nothing to do with this.
>> Function signatures become horrendous lists of xxx:yyy->zzz
as example that i recently stumbled upon - fastapi, and few others in its vicinity. Seems IDE-fancy-ability trumps common sense. But anyway.