Hacker News new | ask | show | jobs
by IshKebab 109 days ago
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!

1 comments

the alternative should be using a real statically-typed language instead of glorified comments that don't do anything without outside tools.

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.

Well yes I agree using Rust or whatever would be better, but if your options are Python or Python with type hints, then the latter gets you closest to proper static typing. They're really not that bad with Pyright in strict mode. Mypy is rubbish.