3 ms·
I agree that complexity could be an issue with Python's typing, which has some flaws, although it's been improving. Type aliases are okay if they're not overly
by saila 4y ago
I agree that complexity could be an issue with Python's typing, which has some flaws, although it's been improving.
Type aliases are okay if they're not overly complex, having used them in Python and other languages to good effect, e.g. to avoid duplication or for clarity.
I'd suggest using type annotations where it's not overly onerous--which is probably most places--to get the benefits without much effort but perhaps avoid them or use simplified types where it's too complex.
I also agree that there are places where typing is unnecessary and doesn't add much value, such as in certain scripts.
Like many things in programming, it's all about finding the right trade-offs.