Wandering Thoughts archives

2014-06-23

Python 3 has already succeeded in the long run

Somewhat recently there has been a certain amount of commotion and strong articles about what Python needs to do about the Python 2 versus Python 3 in order to for one or the other or both to grow and be successful. People's prescriptions have been all over the map; I think I've even seen articles advocating discarding Python 3 as a failed experiment and going back to Python 2 development as the way forward. Given that I'm strongly down on Python 3, you might expect me to agree with the people calling for some sort of major course correction in overall Python development (even if I don't necessarily agree with their suggested changes). As it happens, I don't. My view is that Python development has no need to change in order to 'save' Python or to make Python 3 a success.

The reality is that Python 3 has already succeeded, like it or not. It passed critical mass a long time ago, and while it may be slow moving today it's become inevitable in the long run. More and more major packages are being ported to Python 3, more and more coding is being done on on Python 3 instead of Python 2, more and more people are advocating for Python 3 and its advantages, Python 3 is in more and more places (even if it's sometimes slow), and in the long run more and more things are going to only support Python 3.

If Python 3 was going to fail we would have already seen that by now. We would have seen things like major Python packages announcing that they would never be porting to Python 3, no matter what; they would maintain and develop Python 2 versions only. Instead we've seen just about the opposite, where almost everyone has some sort of Python 3 porting story going on even if they haven't delivered it yet.

Ultimately all of this has happened because the Python developers have made it clear that it is their way (ie Python 3 as it is today) or the highway. No one has stepped up to present a serious alternative to this (ie to further develop Python 2) and given that Python 3 is still broadly Python and is a reasonably viable option most people are not going to take off for the highway. They may be writing Python 2 code today (and perhaps griping about the situation, as I do) but the odds are quite good that in five or ten years they will have switched to Python 3 for new work just because, well, they might as well, it works okay, it's not that different, and it's better supported and shinier than Python 2.

(Old code may or may not ever get ported from Python 2 to Python 3, but then a lot of code dies out over a span of five or ten years anyways.)

Oh, sure, some people will take off for the highway. Some of them will be vocal and thus disproportionately visible. I may even wind up being one of them, if I decide that Go is really what I want to be coding everything in. But I think that most people are going to stay with Python and that means that most of them will move to Python 3 sooner or later. The question is no longer 'if' but 'when', and that means Python 3 has already won even if it takes ten years for it to be pervasive.

Note that this is very different from whether or not I think that that Python development should change. I definitely wish that it would change and I think that relatively modest changes could make a gradual switch to Python 3 noticeably easier. But the Python developers are not listening to me and I think that the current state of affairs demonstrates that they have no need to do so.

PS: this doesn't mean that I plan to switch to writing new code in Python 3 any time soon. Everything I wrote before about that still applies today. I don't expect to start writing Python 3 code until doing so is clearly easier and better than trying to do the same thing in Python 2 (due to nice features in Python 3, better package support, and so on, all of which I expect to happen someday but not any time soon for the work I do).

Python3HasSucceeded written at 21:53:47; Add Comment

2014-06-20

What Python versions I can use (June 2014 edition)

Because I like depressing myself and being harsh on Python 3, and also because Ubuntu 14.04 LTS and Red Hat Enterprise 7 were both released relatively recently, I'm going to inventory what versions of Python (both 2 and 3) are available to me on the various machines that I use and care about. Let's start with the two recently released major Linux distributions, because there's some terrible news for Python 3.

As I write this, the current versions of Python are 2.7.7, released May 31 2014, and 3.4.1, released May 19 2014 (Python release dates and release notes are all nicely accessible here).

Ubuntu 14.04 LTS ships with Python 2.7.6 and Python 3.4.0. These are almost current; in fact Python 3.4.0 was released at most a month before 14.04 itself was (14.04 was released in mid-April) and at the time of its release 14.04 shipped with the latest available versions of Python 2 and 3. Unfortunately but typically, Ubuntu probably won't update either over the lifetime of 14.04 LTS. Ubuntu LTS people are stuck with these versions for the next two years.

Red Hat Enterprise 7 ships with Python 2.7.5 and as far as I can tell no version of Python 3 at all in the standard version; possibly you can install a version of Python 3.3 in /opt through the RHEL/CentOS 'SCL' system. The upshot is that unless you go significantly out of your way you're not going to be using Python 3 on a RHEL 7 machine. RHEL and CentOS people are likely stuck with this whole situation for three or four years until the next version of RHEL is released.

We're still actively using Ubuntu 12.04 LTS and 10.04 LTS; these have Python 2.7.3 and Python 2.6.5 respectively. For Python 3 they have 3.3.2 and 3.1.2. Our remaining 10.04 machines will go away over the next year, bringing me up to some version of 2.7 on all our Ubuntu machines. Python 3 usage on either machine is probably hopeless, especially on 10.04; my impression is that if you're going to code to Python 3 you should be using 3.4 if at all possible and certainly some relatively recent version.

The current version of OmniOS ships with Python 2.6.8 and no version of Python 3. According to the OmniOS people you are not supposed to use their system version of Python but instead build your own at whatever version you want; however, their system version is camping on the /usr/bin/python name so in practice that version is what we'll use on OmniOS for script portability and so on (we have lots of scripts that start '#!/usr/bin/python' and we have very little interest in changing that). This means that I can't use 2.7 only features in portable system management Python scripts (or in scripts intended to run on our fileservers).

My Fedora 20 machines have Python 2.7.5 and 3.3.2 (which is the same version as is on Fedora 19). Based on evidence so far, Fedora probably won't update either version, so for more recent versions I get to wait for Fedora 21 (expected in the fall).

Wandering Thoughts is currently hosted on a FreeBSD 9.2 machine with Python 2.7.5 and no version of Python 3 installed. I don't know FreeBSD well enough to figure out from their website which version or versions FreeBSD 10 comes with, and it's probably not relevant to me anyways; the current host probably won't upgrade any time soon (and I'll probably never port DWiki to Python 3).

We don't currently have any Debian machines, but we might in the future if the Debian LTS effort catches on. Debian 6 'squeeze' (the only current LTS release) has Python 2.6.6 and Python 3.1.3, but we're unlikely to adopt that since it was released back in 2011. Debian 7 'wheezy' has Python 2.7.3 and unfortunately only Python 3.2.3.

I no longer care about the state of Python on Solaris; we're replacing our Solaris fileservers with new OmniOS fileservers.

The good news is that I can assume 2.6 everywhere and 2.7 on most places. The bad news for fans of Python 3 is that the Python 3 situation is still a disaster, alternating between outdated versions and being entirely missing. The odds of getting a good, up to date version of Python 3 on a machine when you type python3 is still rather low.

(See also the 2012 version of this. It's a bit striking how little has changed in two years, although some of that is that Python 2 is not exactly moving fast.)

MyPythonVersions2014-06 written at 02:33:57; Add Comment

By day for June 2014: 20 23; before June; after June.

Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.