4 ms·
Well... type hinting does not seem to be very popular
by galacticdessert 6y ago
Well... type hinting does not seem to be very popular
- Macha 6y agoAt 65% of developers using it at least sometimes, it seems surprisingly widespread. Now obviously this survey is going to be somewhat self selected among devs that like to keep up to date and try new things, but 65% having used it in some capacity is pretty comparable to Typescript: https://2019.stateofjs.com/javascript-flavors/typescript/ https://2019.stateofjs.com/javascript-flavors/typescript/
- user5994461 6y agoThe survey has 75% of users on python 3 in 2017, when a good half of popular libraries still didn't support python 3 at all. It's clearly skewed toward devs on the bleeding edge.
- black3r 6y agoI mostly use Python for web development and I've stopped using Python 2 for that with 3.5, so in early 2016, but I do remember that some machine learning or data analysis tools were stuck on Py2 for a little longer. I definitely wouldn't say that half of popular libraries in general didn't support python 3 at all back then, but for some use cases that may have been true tho.
- rbanffy 6y ago> good half of popular libraries still didn't support python 3 I don't know where you took your number from, but I don't think that's the case anymore. Also, a lot of once-popular libraries were succeeded by now-popular libraries that run with Python 3.
- Majestic121 6y agoAccording to https://python3wos.appspot.com/ https://python3wos.appspot.com/ there were already 50%+ of the most popular packages compatible with Python 3 by the end of 2012
- rbanffy 6y agoI treat it as a form of documentation, a step up from docstrings, with the nice touch some tools can actually test it.
- memco 6y agoI’m trying to use them more and they are helpful but they can be tedious because now I sometimes have to remember to import the right typing modules and I’m not very comfortable with typed sequences or union types. Anyone have a good cheat sheet or reference? I’m adding them to code I’m refactoring and it definitely helps there. Instead of a random named variable I can now get completions for the thing I’m working on and dependencies are a lot easier to see and use.
- carapace 6y agoI started adding type hints to some Python code the other day and something in my brain was like, "WTF!? Just use Haskell!" When you add types to Python code it tends to destroy the elegance and readability of it, which is Python's main advantage over other languages. If you're paying the overhead of adding type information already, you might as well use a language like Haskell that makes it first class and unlocks a ton of power and elegance (and convenient tooling.) Python has a sweet spot but IMO explicit typing draws it away from that. Python is a very complicated and sophisticated semantics that acts like a simple and easy semantics. It's a delicate balance.