4 ms·
> I've never found myself wanting a type checker Do you still write type hints, but not check them? Or just use dynamic typing as in Python 2? Actually, I gue
by pansa2 2y ago
> I've never found myself wanting a type checker
Do you still write type hints, but not check them? Or just use dynamic typing as in Python 2?
Actually, I guess the first case is really type-hints-as-comments, so isn't substantially different from the second.
> I've been using Python for right about 20 years now
Either way, I've found it quite common among long-time Python users to stick with Python's traditional dynamic typing, whereas newcomers to the language tend to really dislike it in favour of strict static typing. (One exception is GvR himself, who seems to be very pro-type-checking.)
As the second group continue to add increasingly complex typing features to the language, I wonder if Python is becoming less desirable for those in the first group.
- zahlman 2y ago>Do you still write type hints, but not check them? Or just use dynamic typing I occasionally write them as a form of documentation - when it would be more concise than explaining in prose. There is nothing specifically 2.x-style about making use of dynamic typing - it's a core property of the language. While 3.0 introduced the annotation feature, it wasn't even specifically intended for typing (https://peps.python.org/pep-3107/ https://peps.python.org/pep-3107/) and standard library support wasn't added until 3.5 (https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html). >As the second group continue to add increasingly complex typing features to the language, I wonder if Python is becoming less desirable for those in the first group. Some new changes have been missteps, in my view. There's still nobody forcing my hand when it comes to typing, really; I just shake my head when I see people trying to make it do things it really wasn't designed for. On the other hand, there are definitely things I'd love to see improved about the language.