I can't help but find type hints in python to be..goofy? I have a colleague who has a substantial C++ background and now working in python, the code is just littered with TypeAlias, Generic, cast, long Unions etc.. this can't be the way..
I strongly disagree. Python has actually done a decent job of adding type annotations into the language IMO. If you ignore the bit where they don't actually specify their semantics anyway. > this can't be the way.. The alternative is fragile and unmaintainable code. I know which I prefer!
I understand that very large code bases have been built in python and this is a compromise to avoid making them rewrite Ks upon Ks of LoC but as it stands, Python type annotations are akin to putting a Phillip's head screwdriver on a ball peen hammer; the screwdriver is not a real screwdriver and the ergonomics of the hammer have been compromised.