[Python-Dev] Python 3 migration status update across some key subcommunities (was Re: 2.7 is here until 2020, please don't call it a waste.)

Ludovic Gasc gmludo at gmail.com
Mon Jun 1 22:20:56 CEST 2015

2015-05-31 16:15 GMT+02:00 Nick Coghlan <ncoghlan at gmail.com>:

> On 31 May 2015 at 19:07, Ludovic Gasc <gmludo at gmail.com> wrote:
> > About Python 3 migration, I think that one of our best control stick is
> > newcomers, and by extension, Python trainers/teachers.
> > If newcomers learn first Python 3, when they will start to work
> > professionally, they should help to rationalize the Python 3 migration
> > inside existing dev teams, especially because they don't have an interest
> > conflict based on the fact that they haven't written plenty of code with
> > Python 2.
> > 2020 is around the corner, 5 years shouldn't be enough to change the
> > community mind, I don't know.
> The education community started switching a while back - if you watch
> Carrie-Anne Philbin's PyCon UK 2014 keynote, one of her requests for
> the broader Python community was for everyone else to just catch up
> already in order to reduce student's confusion (she phrased it more
> politely than that, though). Educators need to tweak examples and
> exercises to account for a version switch, but that's substantially
> easier than migrating hundreds of thousands or even millions of lines
> of production code.

About the French article about Python 3 from a teacher on the production
field, it's available again:

> And yes, if you learn Python 3 first, subsequently encountering Python
> 2's quirks and cruft is likely to encourage folks that know both
> versions of the language to start advocating for a version upgrade :)

Exactly ;-)

> After accounting for the "Wow, the existing Python 2 install base is
> even larger than we realised" factour, the migration is actually in a
> pretty good place overall these days. The "enterprise" crowd really
> are likely to be the only ones that might need the full remaining 5
> years of migration time (and they may potentially have even more time,
> if they're relying on a commercial redistributor).

More than a full-monty toolbox to migrate to Python 3 now available, I've a
good hope when I see numbers like this:

Even if we have a statistical bia because it's only Pythonists who keep an
eye on the Python actuality who have answer to this survey, by definition,
people who are more aware about Python 3 migration than the "average"
Python user, however, I don't remember exactly the theorem, but I know to
diffuse a piece of information inside a community and to be accepted, the
most work will be with the first 10%.
After 10%, you have enough people to start to invert the network/group
effects to keep the previous status.

BTW, during PyCON, Guido did a keynote where he noticed that a lot of
libraries don't support Python 3 yet, however a lot of famous Python
packages are already ported.
If about the absolute values, I was agree with him (more or less 5000
Python 3 packages on 55000 of PyPI if I remember), we should maybe do some
"datamining" with PyPI data to have a more precise vision of the situation,
for example:

1. Requests with 4195790 of downloads supports Python 3. hikvision,
9 downloads, doesn't support Python 3. It isn't fair to count with the same
weight both products.
In term of probability, you have more chances in your project to use
Requests that use hikvision. If we ponderate each package by the number of
download and calculate the percentage, we should have more of less the
probability that a lambda project has all dependencies available for Python

2. The acceleration of Python 3 adoption on PyPI: More complicated to
calculate that because we need to know when the Python 3 trove classifier
has appear on each library metadata. However, I'm pretty sure that we
should see an acceleration. And we should be capable to do a prediction for
a date range when a majority of Python packages will be available for
Python 3.

3. Maybe some other hidden data, maybe Python scientific community should
have better ideas.

Web frameworks have allowed Python 3 development for a while now, and
> with Django switching their tutorial to Python 3 by default, Django
> downloads via pip show one of the highest proportions of Python 3
> adoption on PyPI. www.python.org itself is now a production Python 3
> Django web service, and the next generation of pypi.python.org will be
> a Pyramid application that's also running on Python 3.

Pretty cool :-)

> The dedicated async/await syntax in 3.5 represents a decent carrot to
> encourage migration for anyone currently using yield (or yield from)
> based coroutines, since the distinct syntax not only allows for easier
> local reasoning about whether something is an iterator or a coroutine,
> it also provides a much improved user experience for asynchronous
> iterators and context managers (including finally handling the
> "asynchronous database transaction as a context manager" case, which
> previous versions of Python couldn't really do at all).

Clearly, it should be cool that Python 3 becomes trending from async
pattern community.

> The matrix multiplication operator is similarly a major improvement
> for the science and data analysis part of the Python community.
> In terms of reducing *barriers* to adoption, after inviting them to
> speak at the 2014 language summit, we spent a fair bit of time with
> the Twisted and Mercurial folks over the past year or so working
> through "What's still missing from Python 3 for your use cases?", as
> Python 3.4 was still missing some features for binary data
> manipulation where we'd been a bit too ruthless in pruning back the
> binary side of things when deciding what counted as text-only
> features, and what was applicable to binary data as well. So 3.5
> brings back binary interpolation, adds a hex() method to bytes, and
> adds binary data support directly to a couple of standard library
> modules (tempfile, difflib).

I've made a daemon to provision a lot of stuff, I've a lot of code inside
to switch between bytes and string exactly for that.

If I understand the situation correctly, the work Guido et al have
> been doing on PEP 484 and type hinting standardisation is also aimed
> at reducing barriers to Python 3 adoption, by making it possible to
> develop better migration tools that are more semantically aware than
> the existing syntax focused tools. The type hinting actually acts as a
> carrot as well, since it's a feature that mainly shows its value when
> attempting to scale a *team* to larger sizes (as it lets you delegate
> more of the code review process to an automated tool, letting the
> human reviewers spend more time focusing on higher level semantic
> concerns).

Yes, indeed, it's another carrot.

Finally, both Debian/Ubuntu and Fedora are well advanced in their
> efforts to replace Python 2 with Python 3 in their respective default
> images (but keeping Py2 available in their package repos). That work
> is close to finished now (myself, Slavek Kabrda, Barry Warsaw, and
> Matthias Klose had some good opportunities to discuss that at PyCon),
> although there are still some significant rough edges to figure out
> (such as coming up with a coherent cross-platform story for what we're
> going to do with the Python symlink), as well as a few more key
> projects to either migrate entirely, or at least finish porting to the
> source compatible subset of Python 2 & 3 (e.g. Samba).

Yes, at least from my professional experience, Python-Debian team has done
an awesome job for that: It works like a charm.

> Cheers,
> Nick.
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150601/7ffb37e5/attachment-0001.html>

More information about the Python-Dev mailing list