On Sun, Jan 09, 2022 at 01:30:33AM +0100, email@example.com wrote:
In the last year I’ve contributed mods to two packages that were rejected because I hadn’t provided typing (and black formatting, but that’s a different subject). I’ve reluctantly done so. And while I *hated* it because of the unreadability I _do_ like the outcome
Typing is hard because it is often more abstract and less concrete than the code you are adding type hints to. It is *metaprogramming*. And it involves unfamiliar jargon (covariant, contravariant, typeguards, etc). But the annotations themselves are plain ol' Python expressions.
So if you hate type annotations because they are unreadable, then you hate Python because Python is unreadable.
There may be some unfamiliarity if you aren't doing a lot of typing (what's a ParamSpec?), and due to the use of square brackets instead of round, but if you can read expressions:
spam(eggs | cheese, aardvark)
then you can read type expressions:
Spam[Eggs | Cheese, Aardvark]
Creating a whole new language to describe type hints will go against that. All the existing complexity of typing will still exist, but on top of that, there will *also* be the problem that the syntax used for type expressions will *not be Python* but a second language.
Wrapping that second language in t"..." will not change that.