3 ms·
Perhaps it is just about the features I personally use, but I find generally Python releases are mostly cosmetic. Big changes are included, but don’t drive the
by rich_sasha 6y ago
Perhaps it is just about the features I personally use, but I find generally Python releases are mostly cosmetic. Big changes are included, but don’t drive the changes.
2 -> 3 was mostly about Unicode and print being a function. There was a ton of operational improvements, but none of them were breaking changes that warranted a change.
Type hints are cute, but as other remarked, they are glorified comments. Mypy worked without them in 2.x . Not saying it’s bad to have them, but that it is cosmetic.
From my point of view, the major improvements are on side tracks:
- multicore support via sub interpreters (multiprocessing et al is clumsy and awful on Windows)
- some modicum of static safety; like constants and declaring new variables to help with typos.
You might say that these don’t fit in with Python, but I disagree. It would genuinely be a better language, in particular for its current use cases.
But no, Unicode and fancier comments / annotations it is.
- orf 6y ago> Type hints are cute, but as other remarked, they are glorified comments. Mypy worked without them in 2.x . Not saying it’s bad to have them, but that it is cosmetic. That’s underselling them. They are definitely more than glorified comments and have unlocked a bunch of cool things like data classes and typed dispatch, as well as making a generally big impact on the ecosystem. Mypy worked around not having them in 2.x with what amounted to a hack, which nobody seriously liked using for a number of reasons.
- rich_sasha 6y agoI'm certainly glad they are there. It's a better language with them. My point is, they are really just syntactic sugar. Leaving mypy aside, attrs works perfectly well without annotations, and frankly I find it more powerful than dataclasses anyway. As I said before, maybe it is just that my use-cases are so different to others' (data science vs. web etc.). But Python is screaming for proper multicore support, better static safety, and presumably other things too. Instead we get niceties. And yes, of course, it's free, and it's great, and I'm not a contributor (not really in a position to contribute). So I'm not complaining. But also I gained next to nothing from upgrading from 2.7 to 3, and would gain nothing from going up the 3.x ladder. So it's hard for me to whip up enthusiasm about another version of type annotation goodness.
- barumi 6y ago> Type hints are cute, but as other remarked, they are glorified comments. Mypy worked without them in 2.x . Not saying it’s bad to have them, but that it is cosmetic. Thus assertion is simply outright wrong. Type hints were standardized and, albeit optional, they provide a fixed target for implementations to provide the same service in a perfectly interoperable way. You might not see their point because you chose to not follow best practices, but others among us are very glad Python finally added official support for those.
- rich_sasha 6y agoAnd why might you assume I don't use them? I do, and they are useful. If I had to type them in as comments, I would still use them, and probably not suffer too much. They are a good thing, but I really think Python has bigger issues ahead. I'm beginning to wonder if Julia will overtake it in scientific programming, a notion I would have considered ridiculous a mere year ago. And that, I think, would be a shame - good job for Julia, but for me, the real magic sparkle of Python is that it is a first-class choice at so many things, _including_ data science. If the herd moves on, and Python becomes yet-another-2nd-choice for data science, that would be a real blow to its ecosystem.