My completely anecdotal view on the state of Python 3 in 2016. Based on my own recent experience, observations, and exchanges with other members of the Python community.
Looking at the PyPI download statistics1, the Python 3 situation seems gloomy: all Python 3 versions together are about as popular as Python 2.6 that nobody should use anymore.
And if my company is any indication, Python 2 applications are unlikely to be ported to Python 3. Why should they? Python 2 is officially supported until 2020. Who knows whether the app will exist in that form by then.
The number of these applications is huge. And this number won’t decline significantly in the foreseeable future. Nobody wants to touch their working systems2.
The Very Gradual Improvement
The vast majority of important libraries on PyPI are hybrid: they support both Python 2 and 3. It’s very rare that someone releases a Python 2-only library nowadays (I’m rather seeing occasionally the opposite and so does Microsoft).
New projects and applications are started frequently3 in Python 3. For example, Patreon moved from PHP to Python 3. Why not? Unless you intend to use PyPy (and some rare low-level unicode edge cases aside) it’s objectively the nicer language. How often are new projects started? In the days of micro services maybe more often than one’d think.
Given the state of the libraries, choosing between Python 2 and 3 is a matter of personal preference and company policy rather than technical reasons.
Especially community members that joined us later and don’t have such an ingrained antipathy to Python 3 find it natural to use Python 3. I’ve seen that both in the Twisted and the Pyramid communities. People have been trying to use Twisted on Python 3 long before it was really fit for it. Django – one of the main entry drugs to Python – by itself did a dent in Python 3 usage by using its syntax in their documentation.
Now remember what enormous growth the Python community had in the past months and years. At some point those people are going to be in charge while the old guard yells at clouds. This transition has already begun.
@hynek more anecdote: kids in UK learn Python3 - it's the standard promoted by @Raspberry_Pi & soon #BBCMicroBit via @Micropython. #longterm— Nicholas Tollervey (@ntoll) February 17, 2016
@hynek I teach only Python 3 at @treehouse— ❤ (@kennethlove) February 17, 2016
#Python 3: 50%, 2: 65% (overlap), 3 outgrows 2 by 2017-12 (source: @PyCharm stats) contrary to @zedshaw claims in https://t.co/E470kVLq5x pic.twitter.com/CFvTddQnhZ— Andrey Vlasovskikh (@vlasovskikh) November 24, 2016
Interestingly, the various sub-communities are coping differently. For example the scientific community is way ahead of the average which in my opinion is caused by the huge influx of new users in recent years. IPython/Jupyter even intends to release a first major Python 3-only release (6.x) in 2017.
asyncio is another interesting topic. I was surprised how alive and well that little corner of the Python community is (albeit in mainly Russian speaking countries 🙂). Deservedly so I may add. So I’m not surprised that Python 3.4 was the first one with serious adoption.
What does all that mean?
It means we have to write hybrid libraries for PyPI for the foreseeable future4.
It means that the PyPI download statistics won’t look much better anytime soon due to sheer numbers of written Python 2-only code and Python 2.7 still growing.
But it also means that Python 3 is growing. A new generation of Python developers likes it and doesn’t understand why anyone would want to subclass
object in each class.
And finally it means that Python 3 is not the death of Python. But we’ll have to live with two Pythons for quite a while. If we manage to not kill each other over it, everyone’s gonna be fine.
We for one start all our new projects in Python 3.5 nowadays and don’t want to go back. So stop arguing about it and just join us. I think you’ll like it.
- Those numbers have to be taken with a grain of salt anyway. Mirrors, caching, system packages, et cetera skew them in unpredictable ways. Interestingly, I’ve been told that macOS wheels for NumPy are above 30% for Python 3. For scientific packages, this information is much more telling than sheer download numbers. ↩︎
- Even though porting to Python 3 with a good test suite is not a big deal. But few have good test suites and even fewer have incentives to invest any time into it. ↩︎
- Sorry, I can’t quantify this. It’s just the general sentiment that I hear around me. One of the biggest problems of this discussion is that it’s virtually impossible to quantify anything. ↩︎
- Although I’d like to invite you to join me dropping Python 2.6. ↩︎