News for hackers. Stuff that matters.
Re:Why type hinting sucks (/r/Python) by tuukkah on Saturday February 11, 2023 @09:24AM (#34752505)
The trick is to focus on the types of (top-level) functions. This way, it can be super concise and machine-readable API documentation.

Regarding the example of the original article, it demonstrates how type hinting doesn't turn a language like Python or JavaScript into Haskell, where everything is neatly typed. Type-wise, it just does not make sense to use the operator + for both addition and concatenation, hence the example function slow_plus does not make sense either.

I admit I have difficulty knowing when I should just use Any and stop trying harder.

There are no comments on this comment yet.