DEV Community

Discussion on: Using Python's Type Annotations

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I'm not saying it doesn't have uses, I'm saying that the basic syntax makes the code worse than it was before. The lying about the types will create more bugs.

This type of behaviour is very unusual for a language feature. Most features add value of some kind, or at least sit at zero value. This one actively reduces the ability of somebody to write proper code by misleading them about what is happening.

The fact it has some benefits does not outweigh these guaranteed negatives.

Thread Thread
 
jirinovakcz profile image
Jiri Novak

After several months your comment seems wrong. Large number of questions on /r/learnpython wouldn't have been even asked if using type annotations + mypy.

Typical mistake: missing int() when using input() to read int values.