In Memoriam of Python 2

Generated by Bing Image Creator

Today, on the Day of the Dead 2023, we at the Internet Archive honor the death of Python 2. Having mostly emerged from one of the greatest software upgrade SNAFU’s in history—the migration from Python 2 to Python 3—we now shed a tear for that old version that served us so well.

When Python 3 was launched in 2008, it contained a number of significant improvements which nevertheless broke compatibility with the previous version of Python at the syntax, string-handling, and library level. As terrible as this sounds, breaking changes are fairly normal for a major software upgrade.

Rather, the chaos that followed was rooted in the fact that unlike most software transitions of this sort, it could not be done incrementally. Instead of being offered a way to gradually upgrade, remaining compatible with both versions and spreading the incremental costs over time, developers were given a risky all-or-nothing choice. The result has been a reluctant, glacial, expensive migration that continues to plague the world.

At the Internet Archive, we did not begin our migration in earnest until 2021, starting with Open Library and then this year focusing on Archive.org and its underlying services. However, we are now happy to declare migration of our core storage service, S3, which underlies all of the millions of items stored in the Archive, complete. We are grateful for the intensive efforts over many months by Chris, Scott, and Tracey, and everyone who supported them!

There are just a few more projects to go, but we are nearly there. And come our next OS upgrade, Python 2 will be but the whisper of a memory, preserved in the Archive and honored on a day like today. Rest in peace, Python 2. And please stay dead.

6 thoughts on “In Memoriam of Python 2

  1. Joseph Mitzen

    “Rather, the chaos that followed was rooted in the fact that unlike most software transitions of this sort, it could not be done incrementally.”

    There wasn’t “chaos”, and this isn’t correct. There were tools available to assist in the porting of code, and one could use “from future import ” to transition over piece by piece to Python 3
     
    ” developers were given a risky all-or-nothing choice.”

    Python 2.x was maintained for TEN YEARS, and several old constructs even ported over to Python 3 to ease transition. There was nothing risky here.

    ” The result has been a reluctant, glacial, expensive migration that continues to plague the world.”

    Python 2 was end-of-life January 1, 2020. By that time all significant libraries and all other libraries worth using had been ported to Python 3. Other than the coincidental emerge of COVID-19, leading to jokes about the death of Python 2 really causing the end of the world, there were no measurable consequences. No one even talks about Python 2 anymore; it certainly is not “plaguing the world”. Jetbrains’ survey of the Python landscape for 2022 stated regarding Python versions, “More than 90% of respondents have already implemented Python 3, so can be said to have already achieved mainstream acceptance. The number of Python 2 users has remained nearly the same for the last 3 years, below 7%.”
    That’s hardly a glacial migration plaguing the world!

    “At the Internet Archive, we did not begin our migration in earnest until 2021”

    Python 3.0 was released at the end of 2008, Python 2 went EOL in 2020 and you didn’t start migrating in earnest until 2021. That can’t be blamed on Python.

    1. Paul Boddie

      “There were tools available to assist in the porting of code, and one could use “from future import ” to transition over piece by piece to Python 3”

      “from future import” didn’t really help with fundamental behavioural changes, like the way that various methods became “lazy”, or the way various types changed their behaviour. Python is somewhat amenable to static analysis, but very little effort was expended towards proper migration tools. I imagine that it gave certain pushy, favoured tool vendors a commercial opportunity, though.

      “There was nothing risky here.”

      If you have to port your code to something else, so as to continue to be able to run that code, then there is obviously risk involved. Even if Python 3 had been capable of running Python 2 programs unchanged, there would have been an inherent level of risk. And that is just technological risk, never mind the commercial risk inherent in shouldering the extra workload for such a migration.

      “By that time all significant libraries and all other libraries worth using had been ported to Python 3.”

      How many libraries were abandoned or left as Python 2 only? And what was the cost of porting “all significant libraries” to Python 3? Had Python 2 been evolved instead of introducing an incompatible variant, all that cost could have been saved, and resources could have been directed towards genuine improvements in all that software.

      This is the story of quite a bit of Free Software in the first decade of this century: the two major Free Software desktop environments both lost their marbles in their own distinctive ways, introducing fads that had caught the developers’ eyes instead of building on and improving what were credible offerings. I’m not entirely convinced we are back where we were fifteen years ago in some respects.

      “No one even talks about Python 2 anymore”

      No-one in the core Python developer community bubble talks about Python 2, maybe. They would probably rather forget that Python 2 existed, with Python miraculously emerging fully formed as Python 3, although the way that everyone’s pet feature has since been stuffed into the language means that they would probably rather forget that anything before, say, Python 3.8 ever existed, too. Certainly, Python 3.0 would be consigned to collective amnesia.

      “That’s hardly a glacial migration plaguing the world! Python 3.0 was released at the end of 2008, Python 2 went EOL in 2020 and you didn’t start migrating in earnest until 2021.”

      Well, for masochists maintaining Python 3 versions of their code until Python 3.x became a credible replacement for Python 2, we are talking about something approaching a decade’s worth of extra work to support existing users and yet indulge the core developers’ vision. It probably felt pretty glacial.

      Of course, Python 2 is still supported in certain enterprise software distributions. That suited certain commercial interests with a voice at the top table as the software was being pushed off the edge of the desk. Apparently, maintaining an independent long-term support fork of Python 2 and calling it Python will get you sued, however.

      Maybe the revisionism will one day extend to demanding that those of us who used Python 1.x (or even earlier versions) retract all claims that we went anywhere near that, either.

  2. Paul Boddie

    A bit unfair on Python 2 at the end. There are plenty of other users out there, too, even now: people who have not been able to justify the investment in a transition to Python 3. Many of them will just continue to run Python 2, despite squeals of “security” and other rhetoric from the long-running sabotage campaign against Python 2. A campaign that, in practice, was waged against the language’s own community rather than a piece of software technology.

Comments are closed.