zlacker

[parent] [thread] 31 comments
1. foofoo+(OP)[view] [source] 2025-11-19 19:16:21
> I really don't think Python was close to dying

It absolutely was. What saved it was:

1. The data science / AI crowd that was gathering momentum any many only used Python 3.

2. No popular alternative. Perl got python as an alternative.

Python was also a good, simple language and had a good healthy culture. But it's nothing sort of a miracle that it survived that biblical software calamity.

replies(10): >>mixmas+B5 >>dist-e+A6 >>nine_k+T8 >>tptace+z9 >>MoonWa+ya >>skylur+Ib >>matthe+Id >>culi+Uv >>drzaiu+Al2 >>kaashi+ea9
2. mixmas+B5[view] [source] 2025-11-19 19:42:39
>>foofoo+(OP)
I was not affected by Py3 at all. First I completely ignored it for five years while it gestated. Then started kicking the tires when 3.4 dropped on a LTS. When 3.6 with better dicts and f-strings landed I moved over with barely a whimper, since I'd had a decade to get things upgraded to 2.7 first.

None of my projects needed to worry much about char encoding, and I'd used logging extensively starting under 2.6 or so.

replies(1): >>selcuk+MQ
3. dist-e+A6[view] [source] 2025-11-19 19:47:44
>>foofoo+(OP)
You're contradicting yourself - if Python had no popular alternative, what would have new people used instead and what would existing code have migrated to?
4. nine_k+T8[view] [source] 2025-11-19 19:58:32
>>foofoo+(OP)
Python 2.7 was kept very much alive, with a number of small improvements from the 3.x branch backported to it.

Big players, like Django or SQLAlchemy, kept versions both for 2.x and 3.x for quite some time. This allowed for a smooth transition, when all of your dependencies finally had good versions for 3.x.

The difference between Python 2.x and Python 3.x was not dramatic. I would say it was mostly cosmetic up until 3.5 when async landed. Even with these small changes, the splitting of byte strings and character strings alone (an obvious move towards sanity) was plenty annoying for many projects.

Communities and ecosystems are fragile; sharp turns can easily break them.. Even careful maneuvering, like the Python 2 → 3 transition, put very visible strain on the community. A crazy jump that was Perl 6 was not survivable, even though Raku may be a fine language.

replies(1): >>Izkata+xu2
5. tptace+z9[view] [source] 2025-11-19 20:01:35
>>foofoo+(OP)
Long before the AI/data science breakout, we were noticing in our consulting practice (2016-2020) a sharp dropoff in Ruby at startups, and Python as the modal language (by the time I left in 2020, it would have gone Python -> Node -> Ruby).

So no, I don't think AI saved Python; it was fine before then.

replies(1): >>smohar+Go
6. MoonWa+ya[view] [source] 2025-11-19 20:05:32
>>foofoo+(OP)
I don't know. Isn't Python still viewed as a mess now? I was thinking of taking the time to learn it as the best way to write cross-platform utilities, but encountered a lot of negative sentiment about its ecosystem. And all the environment managers you seem to need for it are a turn-off.

Granted, this is coming from a relative noob who read and followed a couple of "how to set up Python properly" articles and that's about it. But I pretty much decided to spend my time on JavaScript, despite its cumbersomeness for implementing simple utilities.

replies(4): >>kstrau+KD >>jujube+Ur1 >>graeme+dl2 >>rasz+pM4
7. skylur+Ib[view] [source] 2025-11-19 20:12:21
>>foofoo+(OP)
> No popular alternative

I can easily imagine a scenario where Julia could have taken the data science crowd and Node.js could have taken everyone else. People like Python, I guess.

replies(1): >>foofoo+yE
8. matthe+Id[view] [source] 2025-11-19 20:23:11
>>foofoo+(OP)
You forgot perhaps the most important one:

3. six

`six` was instrumental in repairing the Python schism by giving people a way to incrementally move their 2.7 code to Python 3, and write code that was compatible in both. The six project didn't exist at first and the path to Python 3 was too painful without it. Six solved all that by smoothing over built-in libraries with different casing between versions, incompatible core libraries, the addition of unicode strings, print changing to a function, etc, etc. Perl 5 to Perl 6 (aka Raku) never got that.

replies(2): >>maskli+An >>tyingq+491
◧◩
9. maskli+An[view] [source] [discussion] 2025-11-19 21:10:01
>>matthe+Id
Six was one component but not the only one. Python 2.7 also backported a number of early Python 3 features, Python 2 features were reintroduced in basically every P3 version until at least 3.5 (although after 3.3 they were pretty minor), and a lot of extensive migration guides were written (my main bible was eevee's).

In my experience, six was a relatively minor part, and you could get by with your own little compat file for just the stuff you needed, even on relatively big projects. I even found it beneficial to do so because instead of just slapping six.moves everywhere you'd have to re-evaluate some of the old decisions (e.g. at $dayjob at the time we were using all of urllib, urllib2, and requests for HTTP calls, not using six provided strong motivation to just move everything to requests). This also made for a lot less churn when removing Python 2 compatibility.

replies(3): >>saurik+hE >>leland+QW >>jeeyou+Jt1
◧◩
10. smohar+Go[view] [source] [discussion] 2025-11-19 21:14:40
>>tptace+z9
2016 already puts one far into the AI explosion. The current hype cycle, with LLMs as a service at the forefront, arguably makes python less relevant than in it was in the mid 2010’s. The current crop of “AI Engineers” can use whatever languages they want for the most part. In 2016 most practitioners were leveraging a lot more of the standard scientific computing frameworks afforded by python.
replies(1): >>tptace+5p
◧◩◪
11. tptace+5p[view] [source] [discussion] 2025-11-19 21:16:45
>>smohar+Go
Python was the lingua franca of data science by 2016, but AI and data science was clearly not the reason startups were building in Django and Flask --- the data science teams were always a morass of Jupyter notebooks and pickle blobs.
12. culi+Uv[view] [source] 2025-11-19 21:48:42
>>foofoo+(OP)
IMO javascript was a valid alternative. Easy to learn and easy to run. That's the main things needed for academic work

Python had a history of tooling/libraries that made it well ingrained into academia

replies(1): >>maleld+oD
◧◩
13. maleld+oD[view] [source] [discussion] 2025-11-19 22:30:27
>>culi+Uv
Javascript didn't have the same FFI story with C/Fortran as Python. That's what allowed libraries such as numpy, scipy, pandas, etc. to flourish.
◧◩
14. kstrau+KD[view] [source] [discussion] 2025-11-19 22:33:02
>>MoonWa+ya
It's vastly improved now. With uv, many times you can download a new utility off GitHub and run it with `uv run foo.py`, including fetching its dependencies.
replies(1): >>MoonWa+YM
◧◩◪
15. saurik+hE[view] [source] [discussion] 2025-11-19 22:35:40
>>maskli+An
> Python 2 features were reintroduced in basically every P3 version until at least 3.5

If they had just done this from the beginning there wouldn't even have been such upgrade drama in the first place... like, as an obvious example, removing u'' syntax for unicode strings immediately at 3.0 was just idiotic: if it weren't for some dumb decisions like that one there would have been almost no upgrade discontinuity at all (a la Ruby 2's Unicode reboot, which concerned a lot of people but was a nothing-burger next to the insanity of Python 3).

replies(1): >>maskli+3q1
◧◩
16. foofoo+yE[view] [source] [discussion] 2025-11-19 22:37:53
>>skylur+Ib
Before JS had promises, JS code was plagued with the callback pyramid of doom. You needed an advanced masters degree in masochism to endure that. I don't think Python devs would have liked that.
◧◩◪
17. MoonWa+YM[view] [source] [discussion] 2025-11-19 23:33:24
>>kstrau+KD
Cool, thanks!
◧◩
18. selcuk+MQ[view] [source] [discussion] 2025-11-20 00:03:55
>>mixmas+B5
Porting your own code was relatively easy. The problem was porting all your dependencies, and replacing the ones that were abandoned and didn't support 3.x.
replies(1): >>mixmas+pZ
◧◩◪
19. leland+QW[view] [source] [discussion] 2025-11-20 00:56:12
>>maskli+An
It's very true, I feel like one of the most useful things python had was stuff like "from __future__ import print_function"
◧◩◪
20. mixmas+pZ[view] [source] [discussion] 2025-11-20 01:14:56
>>selcuk+MQ
I did wait a bit for Django and SQLAlchemy but it wasn't long, they may have been ready for 3.6. Small deps were replaced or eliminated.
replies(1): >>maskli+sC1
◧◩
21. tyingq+491[view] [source] [discussion] 2025-11-20 02:34:01
>>matthe+Id
six did help a lot. Didn't help with some things, though, like strings vs bytes vs bytearray.
◧◩◪◨
22. maskli+3q1[view] [source] [discussion] 2025-11-20 05:16:41
>>saurik+hE
Sure but importantly they did realise they had erred and course-corrected.

> if it weren't for some dumb decisions like that one there would have been almost no upgrade discontinuity at all

Having been there and done that, nah, the text model changes alone required significant work to square up in most packages. And there were plenty of other semantics changes.

replies(1): >>saurik+G06
◧◩
23. jujube+Ur1[view] [source] [discussion] 2025-11-20 05:42:43
>>MoonWa+ya
Python is great for data science. Anything where you need to wrap a C library like BLAS, tensorflow, PyTorch, matplotlib, numpy.

It's hot garbage for writing simple cross-platform utilities because of the need for an elaborate environment setup, painful dependency management, and constant compatibility breaks.

◧◩◪
24. jeeyou+Jt1[view] [source] [discussion] 2025-11-20 06:02:55
>>maskli+An
As a user, you may not appreciate six, but popular libraries like Django would've never made the jump without six.py;
replies(1): >>maskli+8z1
◧◩◪◨
25. maskli+8z1[view] [source] [discussion] 2025-11-20 07:05:16
>>jeeyou+Jt1
I’m not talking as a user, I’m talking as a person who ported 350kLOCs of python from 2 to 3.

Django absolutely would have been ported: it was ported without six by Vinay Sajip (building on an earlier work of Martin von Löwis). In fact a limited shim layer was initially committed based on Vinay’s efforts: https://github.com/django/django/commit/5e6ded2e58597fa324c5...

The team ultimately decided to use and re-export six for the convenience of the ecosystem, not out of any sort of necessity.

◧◩◪◨
26. maskli+sC1[view] [source] [discussion] 2025-11-20 07:40:15
>>mixmas+pZ
They were ready long before 3.6, sqlalchemy added support for Python 3.1 in 0.6, and Django 1.5 introduced support for Python 3.2 on an experimental basis with 1.6 removing the “experimental” bit.
◧◩
27. graeme+dl2[view] [source] [discussion] 2025-11-20 14:14:52
>>MoonWa+ya
Its much exaggerated.

Its got a big standard library so you can do a lot by just installing Python. On a lot of *nix systems it will all be installed already. For simple use cases you do not have to have the environment manager.

I have had few problems with virtualenv in any case.

Where you are most likely to have problems is cross platform deployment. If you are going to package it as an exe for Windows users, and package it for major Linux distros, and whatever you need to do for MacOS etc. its going to be a pain. In that case there are multiple languages that might suit you better than JS.

28. drzaiu+Al2[view] [source] 2025-11-20 14:17:18
>>foofoo+(OP)
Anecdotally, I stopped using python for several years around the transition period from 2 to 3 because a number of libraries I used at the time were in flux with 3 support (beautiful soup I _think_ was one? I could be misremembering). Ironically, I ended up just using perl for a scraping tool instead, which it's quite good at for quick and dirty scraping scripts (PCRE.) Nowadays I use ruby for that type of stuff...
◧◩
29. Izkata+xu2[view] [source] [discussion] 2025-11-20 15:08:12
>>nine_k+T8
> the splitting of byte strings and character strings alone (an obvious move towards sanity) was plenty annoying for many projects.

Python 2 had both, it was a rename, not a split. unicode -> str, and str -> bytes. The "u" string prefix was also removed, which made migration of string-heavy code more of a pain than it needed to be, until it was added back in in 3.3

◧◩
30. rasz+pM4[view] [source] [discussion] 2025-11-21 07:41:55
>>MoonWa+ya
>Isn't Python still viewed as a mess now?

Imo the coding part is fine. I have no mayor complains about it. I even like indentation as syntax as long as you use tabs :)

Python is the modern day BASIC. Slow interpreted lingua franca. As long as you are ok with its speed I say go for it. Python is the only scripting language where I maintain constant lingering awareness that every single line of code adds milliseconds to run time. As bad as instantiating new variable costing single digit ms on a GHz CPU. This quickly adds up the more you are trying to achieve.

Example benchmark, Python 3.4:

    # Direct Access d['key']: 3.3710 seconds
    # Direct Enum Access d[enum.key]: 157.9954 seconds
In latest versions Enums got "fixed" to "only" 3-6x slower than strings! SimpleNamespace to the rescue.
◧◩◪◨⬒
31. saurik+G06[view] [source] [discussion] 2025-11-21 17:55:01
>>maskli+3q1
But you could have made those changes incrementally in a way that more cleanly worked across both Python 2 (which already had this split: the default type was just wrong; all of my code, for instance, worked great!... it was just super awkward, as it had tons of u's thrown all over the place). Where they ended up with the language (after, like, 3.7) was much more incremental from Python 2 than the early path to how they got there. To be explicit: it isn't about having to put in upgrade effort, it is about upgrade discontinuity.
32. kaashi+ea9[view] [source] 2025-11-22 22:45:10
>>foofoo+(OP)
It was close to dying, except for these two things that mean it definitely wasn't close to dying?

"Having no popular alternative" is not something that was close to not happening.

[go to top]