Hacker News new | ask | show | jobs
Am I too pessimistic about Python's future?
5 points by noon-raccoon 25 days ago
Python was my main language for more than a decade. My unpopular opinion is that things started to go wrong with asyncio. It feels like a band-aid solution that required a whole new ecosystem to grow around it.

Typing was a good idea, but I feel like it was never fully completed. So we ended up with optional typing, which definitely helps with reading code, but that’s about it. I see many features being implemented to speed up execution, along with attempts — some successful — to overcome the GIL, but all of them look like really complex hacks to me.

Probably because of the PTSD from the Python 3 rollout, there will be no Python 4 that truly addresses the language’s problems.

Over the last few years, I’ve switched to Golang and TypeScript. I miss Python’s elegance, as well as quite a few libraries built for it, but I don’t like the direction the language is heading in. Am I being too pessimistic?

4 comments

I can certainly appreciate the frustrations with newer elements of the language that introduce functionality, I was the same with typing in particular. That said, I came to realise two things: firstly the new elements in the language are not required to write idiosyncratic python the way I like and, secondly, they haven't fundamentally changed anything in the way Python operates as a language.

Python has been around a long time. It's no surprise that it's getting more bloated as an ecosystem. I was anti uv for a time as well, as well as annoyed at the plethora of tools for linting that seemed to ALL get introduced into some projects, conflicting with one another.

I became happier when I remembered to just ignore the things I didn't need or wasn't interested in. uv became a friend, linting I ignore as something I forget about in a pre-commit hook that is configured once across my projects if I use it at all. Typing I've actually realised can be helpful now it's becoming more natively implemented (e.g. no more "import typing"), because I'm getting more forgetful!

The pessimism is justified, so you're not being too pessimistic, but you might want to remember why you love python and ask whether or not it's still able to fundamentally achieve that thing...

You don't like some newer Python features (fair), but I don't think you've mentioned any actual problems that should be addressed. What would a Python 4 that solved everyone's problems and take us to the promised land look like to you?
The Python 2/3 disaster is not even over yet - I had to deal with a Python 2 problem TODAY.

There can be no Python 4.

Ugh, I feel your pain. Why can’t you fully migrate to Python 3? No judgment — just curious.
Not me but a library I use requires Python 2 - to build a version made last month, FFS.
No, I agree with you quite strongly[0].

There is indeed very explicitly no plan for a Python 4, although several people seem to have a vision for it. (I have a design of my own that I think of as a spiritual successor, but I am definitely making more-than-incremental and very much incompatible changes. Python is just the main inspiration for it.)

I haven't switched, though. I just keep avoiding the new constructs. I've found that newer code in popular projects often barely uses the new features; and where they are used, the workarounds are really not that painful.

Except when it comes to the back-and-forth about how to handle forward references etc. in type annotations. That part is a mess.

Speaking of which, there was never any expectation of typing becoming mandatory. And it's good that the world has dynamically typed languages, and I still mostly write my Python code that way, and prefer to read it that way. Type annotations have a lot of second-order effects that aren't all desirable (I have it on my mental list to blog about that). But even beyond that, the annotations feature was ostensibly not specifically about typing in the first place. https://peps.python.org/pep-3107/ is very explicit about that (even type information is about a lot more than mere type-checking, and uses related to documentation were explicitly conceived of). Even if the Python runtime required type annotations everywhere, and refused to bytecode-compile wrongly-annotated code, it's unlikely that this would actually have led to significant optimizations (at least not without a radically different system like mypyc).

Meanwhile, the standard library is full of things that would absolutely never pass muster to be added today, if they weren't already there. And resistance to new suggestions from outsiders (which are mostly for standard library enhancements, but I'm also talking about syntax and builtin methods here) is really strong; but some internal ideas meanwhile seem to get fast-tracked in a way that leaves a horrible taste in my mouth. Overall I wish the base language were more meta-programmable so that people could just try out their new syntax ideas privately with much less effort. (And my own language design definitely takes that into consideration, too.)

The one new thing I really like in Python is 3.14's template strings; it's a shame we didn't get that first. I don't even have obvious use cases for the functionality off the bat, but it seems far more elegant than the things that led up to this point.

[0] Although I set the cutoff point at 3.6 or 3.7. While I don't normally have a use for asyncio and the related keywords and am not a fan of the resulting function colouring, I have to say that f-strings, the compact dictionary representation and improvements to pathlib are all huge wins. On the other hand, "old guard" member Mark Lutz notably dislikes anything past 3.4 (https://learning-python.com/python-changes-2014-plus.html).