4 ms·
This was something that was in vogue in the mid / late 2000s, then Haskell became the cool kid language and types are back. The thing that drives me crazy abou
by tnecniv 3y ago
This was something that was in vogue in the mid / late 2000s, then Haskell became the cool kid language and types are back.
The thing that drives me crazy about Python typing is that I need to import stuff to make full use of the type system. Like I get that the typing is option because that would be a huge language overhaul, but it feels weird that so many tools get hidden inside libraries (standing or otherwise).
- deleted 3y ago[deleted]
- scubbo 3y agoAFAIK, you only need to import the actual types that you're using (`from typing import List, Iterable, Optional, ...`). What else is there?
- bbkane 3y agoIn newer Python versions, you don't need most of those imports either: foo: list[str] = ["a"] bar: int | None = 1
- saulpw 3y agoYeah, but that's completely unnecessary friction.
- scubbo 3y agoGranted - but the original claim was that "it feels weird that so many tools get hidden inside libraries", and I'm asking for an example of more than one of these "so many".
- abdullahkhalids 3y agoBut why do we have to import any? They should be part of the core language by now. The lack of boldness of Python core developers is sometimes very annoying.
- verbatim 3y agoMost of it is part of the core language now.
- CameronNemo 3y agoYep the only one I've found myself importing as of late is Any.