There has been a slow chorus of poor anti-Python 3 articles lately. Today’s was Python 3 is killing Python. The article is “true” in the sense that it accurately reflects the author’s feelings, but the thesis is fundamentally wrong about the language, the language developers, and the community.
Just for the record, there are some very good criticisms of Python 3 like Armin Ronacher’s. So if you want to read something negative about Python 3 go read that. But the thing about essays like that (and other good criticisms about Python 3) is that they have specific things to say about improving Python 3. They do not take the position that we should throw out the last 5 years of Python development and start over.
By the way, if you are interested in a defense of Python 3 by somebody who is actually qualified to write one you should read Nick Coghlan’s Q&A which is as close as you will get to an official position on why we have Python 3 to begin with and why none of the amateur hour ideas are taken seriously. (Excluding, of course, criticisms like Armin’s, which are not amateur hour at all.) Nick Coghlan’s document should really be a required citation for any article advancing a new course for Python, because nobody is going to take you seriously if you don’t address the arguments that have been considered so far.
So some background. The Python project is an open-source project run by an all-volunteer team. Python’s Benevolent Dictator For Life, Guido van Rossum, is not, actually, a full-time Python core developer. He spends a good part of his time writing conflict resolution algorithms for Dropbox. In theory the PSF pays people to work on Python but in practice the total amount spent per year is well under the median salary for 1 software developer.
This means that, in reality, everybody who works on Python does it for fun. There are no customers, and there are no vendors. It’s just people hacking on Python cause they enjoy it.
So in order to argue that Python 3 is bad and development should stop and shift back to Python 2, it is a necessary prerequisite to explain why an all-volunteer army should stop volunteering in the way that they want to volunteer and start volunteering in the way that you want them to volunteer.
There are plenty of ways to convincingly make that argument. One way is to offer to hire the top 10 Python core developers to work on Python 2. Another way is to grab 10 developers around you and contribute to Python 2 yourselves; a group of 10 intelligent, well-funded full-time developers could probably blow past whatever rate of innovation an all-volunteer army can sustain. A third way is to set up an organization that competes with the PSF–that organizes conferences, grants, and hackathons focused around Python 2.
However one argument that definitely does not work is “you should work on Python 2 because that would make my life as a commercial software developer easier”. The fact that Python 2 and commercial software developers had a symbiotic relationship at all was a happy coincidence, never a goal. The goal was “produce a language that Guido van Rossum and the other volunteer developers enjoy.” That goal was achieved with Python 3. The fact that other people’s goals were not achieved is a problem for those people–but it remains to be explained how the hell it becomes Guido’s problem that after a decade of working on Python 2 for free he decided not to anymore.
Python 2 apologists make some extraordinary claims. For example:
One of the great strengths of Python 2 is the long tail of 3rd party libraries to do, well, just about anything. Python 3 doesn’t have this.
It is time for this talking point to die. Of the top 200 3rd party libraries, 80% have Python 3 support at the time of this writing. Of the remaining packages, many are things like supervisor and Fabric that are stand-alone applications where nobody cares what version of Python they run. To say that Python 3 “doesn’t have” 3rd party libraries is not just wrong, it’s completely absurd.
The author also claims that nobody uses Python 3 in production:
Choice #2 is obviously not popular, because if it was, we’d have a lot of Python 3 apps in production, and much of the long tail of Python 2 libraries would be ported. Neither of those things is true.
This is equally absurd. For example in March 2014 Python 3 downloads overtook Python 2 downloads by a healthy margin 54% vs 46%. What are all those people doing with Python 3, if not writing production software? Ubuntu just banished Python 2 from their newest LTS release (well, except for the phone OS). Fedora is rolling over to Python 3 next year. Arch did this back in 2010 (which was arguably early, but in fairness to them they like to be up to date). To say that we don’t have a lot of Python 3 apps in production is not just wrong, it’s totally absurd.
I strongly suspect the “nobody uses this” argument is one of those pesky cases of sampling bias. Python 2 developers know other Python 2 developers. Python 3 developers know other Python 3 developers. Right now about 90% of my projects are Python 3. Most of my friends use Python 3. I no longer make any attempt to make my libraries compatible with Python 2 users. I could go an entire work week without even thinking of Python 2. That is how pervasive Python 3 is in my corner of the world.
Is my experience in any way representative? Of course not. But as one person, I don’t particularly care if it is representative or not–it’s representative for me. Python 3 is now good enough for me to do all the things that I do. For all I care adoption can stay exactly where it is. I am under no particular compunction to spread the gospel of Python 3 because I can just use it and be happy in my Python 3 world.
If Python 2 is so great, then just use it! Go to python.org and click the download button. This is not a task that requires you to argue with anyone. You do not need anybody’s permission. There is absolutely no reason to invade a land where people are happy using Python 3 and convince us that we are bad. Just use it!
The thing is, when the python2ists write pieces like this, they tip their hand. If python2 is great, then there is no reason to convince the dev team to work on it, because it is great already. The only way to even advance the position that resources should be allocated to python2 development is to concede that there is something about it that is unsatisfactory that would justify additional work. And not just “a little bit” unsatisfactory, but so unsatisfactory that it justifies shutting down an entire ecosystem that is working out pretty well for the people currently using it. And kidnapping software engineers who have expressed disdain for Python 2 and forcing them to write code against their will.
Articles like Alex’s suggest the solution is to fork:
One solution is to fork Python 2.7, and continue developing the language, adding features in a backwards compatible way so large, unportable (due to financial constraints) Python 2 applications can continue to evolve and improve and bring value to the people and companies that invested so much time developing them. This is the correct thing to do (actually, it would be best if Guido and other leaders in the Python community did this officially instead of forcing a fork).
Maybe Alex missed it, but here’s the button:
You don’t need permission. You don’t need to argue with anybody. Just do it! It’s not that hard. I’m just some guy on the internet, and I maintain a surprising number of forks of various FOSS projects. I fork more often than once a week.
It’s not even that hard to backport major Python 3 features to Python 2. The work is already done in some cases, like Trollius and six. The fact that nobody has even bothered to take ten minutes to merge Trollius into their Python 2.8 fork is “case closed” level evidence that the demand for Python 2.8 is zero.
Blog posts aren’t demand. Demand is people willing to develop. Demand is people willing to fund development. I’d even settle for a $15 themeforest splash page that lists one corporate sponsor and one developer’s bio. How is it that Python is somehow in grave danger of forking and nobody will even buy a domain name for the fork? People literally do that for a weekend hack project. This is a tempest in a teacup if I’ve ever seen one.
There are a lot of claims in here that are absurdly wrong, but the statement that “nothing much was gained” in Python 3 is a candidate for dumbest statement of the decade. First of all it is wrong because if it were true then it wouldn’t be that hard for people like Alex to press the Fork button and backport all the Python 3 features to Python 2, which nobody does.
But there is an even simpler reason why it is wrong. I present to you, the complete list of changes since Python 2.x:
(The audio will stop playing if you scroll down a bit.)
Now if this entire 192-page document is “nothing really amazing” and “you’re not blown away by it” then that is your prerogative. Perhaps you’re simply not a very excitable person. I suggest an ordinary person would probably find something in there amazing.
Nickous Ventouras’s rebuttal to Alex’s post includes such suggestions as “fix long-standing annoyances”, “shake the API” and “improve speed”. I guarantee you, there is page after page after page of that stuff in the changelog. Python 3 doesn’t need more features–it needs a better PR campaign. The features are already there; people just don’t know about them.
But it is wrong statement of the decade to call this set of release notes “not much”. It’s much. The release notes weigh two pounds. I challenge you to find another project where release notes can be measured by the pound. It took me several tries to find one. The one I found was Rails.
I don’t know much about Rails, but here is a list of compatibility breakages between Rails 4.0 and minor release 4.1. WAT. Oh and they refuse to use semver. And people just deal with it. They even band together to create commercial forks of Rails. As far as I know, Rails is not in a crisis because they break backwards compatibility once a week.
By comparison Python is a paragon of stability. Python 3 has been out for five years. If you can’t lift a finger to port your code in a five-year period then that is your problem. You can’t expect anyone else, least of all a bunch of volunteers, to drop what they are working on and make things easier for you.
In the real world, we break backwards compatibility from time to time. For me the Python community has a long track record of striking the right balance between upgrade windows and introducing cool new features. If it doesn’t strike the right balance for you then go use something else. Volunteers have better things to do than maintain backwards compatibility for five years because you’re lazy.
People who use Python 2 today have a set of options available to them:
People can and do have all of these reactions to the Python 3 transition (although not #8, to my knowledge). What is probably not going to solve anything is whining on the internet that other people won’t do something about it for you.
If you are upset about Python 3 go do any one of those. Complaining on the internet solves nothing. You have no leverage.
Python 3 isn’t having the sort of crisis in confidence where a well-placed blog post could crumble the resolve. It is a thriving and vibrant ecosystem where the sort of people who are actually qualified to defend it are having too much fun using it to bother, and so that task falls to people like me.
The not-very-politically-correct-truth is, the Py3 ecosystem is sufficiently large that it doesn’t really matter at this point when or if all the laggards get on board. There was a time when it mattered more, but these days the ecosystem is sufficiently robust that people like me can go for long periods without ever thinking of Python 2. There is probably more that can be done for criticisms like Armin’s, but largely those are “POSIX border disputes” where something small can address the issue.
Not everybody can forget about Python 2 completely right now, but not everybody needs to move to Python 3 at all, or to use any particular programming language for that matter. Go do what makes you happy.
What makes me happy is using Python 3.