Hacker News new | ask | show | jobs
by toomanydoubts 1624 days ago
Python sucks, type hints border idiocy. If you can't trust the hint to actually be correct and still have to check for yourself, they become pointless.

If you want to see where static typing really shines, try writing some Haskell. It's an absolute delight.

1 comments

What do you mean you can't trust them? If you write a type hint in your code and then run mypy on it, it will tell you whether the type is being violated. And, PyCharm has a type checker built in that lets you know as you're coding.
> If you write a type hint in your code and then run mypy on it, it will tell you whether the type is being violated.

Only if the type hints for all the libraries you use are correct (and in practice they're not).

Ah, thanks. I think I am going to give type hints another try.