<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-05-31 16:15 GMT+02:00 Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 31 May 2015 at 19:07, Ludovic Gasc <<a href="mailto:gmludo@gmail.com" target="_blank">gmludo@gmail.com</a>> wrote:<br>
> About Python 3 migration, I think that one of our best control stick is<br>
> newcomers, and by extension, Python trainers/teachers.<br>
> If newcomers learn first Python 3, when they will start to work<br>
> professionally, they should help to rationalize the Python 3 migration<br>
> inside existing dev teams, especially because they don't have an interest<br>
> conflict based on the fact that they haven't written plenty of code with<br>
> Python 2.<br>
> 2020 is around the corner, 5 years shouldn't be enough to change the<br>
> community mind, I don't know.<br>
<br>
The education community started switching a while back - if you watch<br>
Carrie-Anne Philbin's PyCon UK 2014 keynote, one of her requests for<br>
the broader Python community was for everyone else to just catch up<br>
already in order to reduce student's confusion (she phrased it more<br>
politely than that, though). Educators need to tweak examples and<br>
exercises to account for a version switch, but that's substantially<br>
easier than migrating hundreds of thousands or even millions of lines<br>
of production code.<br></blockquote><div><br></div><div>About the French article about Python 3 from a teacher on the production field, it's available again:</div><div><a href="https://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fsametmax.com%2Fpython-3-est-fait-pour-les-nouveaux-venus%2F">https://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fsametmax.com%2Fpython-3-est-fait-pour-les-nouveaux-venus%2F</a> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
And yes, if you learn Python 3 first, subsequently encountering Python<br>
2's quirks and cruft is likely to encourage folks that know both<br>
versions of the language to start advocating for a version upgrade :)<br></blockquote><div><br></div><div>Exactly ;-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">After accounting for the "Wow, the existing Python 2 install base is<br>
even larger than we realised" factour, the migration is actually in a<br>
pretty good place overall these days. The "enterprise" crowd really<br>
are likely to be the only ones that might need the full remaining 5<br>
years of migration time (and they may potentially have even more time,<br>
if they're relying on a commercial redistributor).<br></blockquote><div><br></div><div>More than a full-monty toolbox to migrate to Python 3 now available, I've a good hope when I see numbers like this:</div><div><a href="http://blog.frite-camembert.net/python-survey-2014.html" target="_blank">http://blog.frite-camembert.net/python-survey-2014.html</a><br></div><div><br></div><div>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%.</div><div>After 10%, you have enough people to start to invert the network/group effects to keep the previous status.</div><div><br></div><div>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.</div><div>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:</div><div><br></div><div>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.</div><div>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 3.</div><div><br></div><div>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.</div><div><br></div><div>3. Maybe some other hidden data, maybe Python scientific community should have better ideas.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Web frameworks have allowed Python 3 development for a while now, and<br>
with Django switching their tutorial to Python 3 by default, Django<br>
downloads via pip show one of the highest proportions of Python 3<br>
adoption on PyPI. <a href="http://www.python.org" target="_blank">www.python.org</a> itself is now a production Python 3<br>
Django web service, and the next generation of <a href="http://pypi.python.org" target="_blank">pypi.python.org</a> will be<br>
a Pyramid application that's also running on Python 3.<br></blockquote><div><br></div><div>Pretty cool :-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The dedicated async/await syntax in 3.5 represents a decent carrot to<br>
encourage migration for anyone currently using yield (or yield from)<br>
based coroutines, since the distinct syntax not only allows for easier<br>
local reasoning about whether something is an iterator or a coroutine,<br>
it also provides a much improved user experience for asynchronous<br>
iterators and context managers (including finally handling the<br>
"asynchronous database transaction as a context manager" case, which<br>
previous versions of Python couldn't really do at all).<br></blockquote><div><br></div><div>Clearly, it should be cool that Python 3 becomes trending from async pattern community.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The matrix multiplication operator is similarly a major improvement<br>
for the science and data analysis part of the Python community.<br>
<br>
In terms of reducing *barriers* to adoption, after inviting them to<br>
speak at the 2014 language summit, we spent a fair bit of time with<br>
the Twisted and Mercurial folks over the past year or so working<br>
through "What's still missing from Python 3 for your use cases?", as<br>
Python 3.4 was still missing some features for binary data<br>
manipulation where we'd been a bit too ruthless in pruning back the<br>
binary side of things when deciding what counted as text-only<br>
features, and what was applicable to binary data as well. So 3.5<br>
brings back binary interpolation, adds a hex() method to bytes, and<br>
adds binary data support directly to a couple of standard library<br>
modules (tempfile, difflib).<br></blockquote><div><br></div><div>+10.</div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If I understand the situation correctly, the work Guido et al have<br>
been doing on PEP 484 and type hinting standardisation is also aimed<br>
at reducing barriers to Python 3 adoption, by making it possible to<br>
develop better migration tools that are more semantically aware than<br>
the existing syntax focused tools. The type hinting actually acts as a<br>
carrot as well, since it's a feature that mainly shows its value when<br>
attempting to scale a *team* to larger sizes (as it lets you delegate<br>
more of the code review process to an automated tool, letting the<br>
human reviewers spend more time focusing on higher level semantic<br>
concerns).<br></blockquote><div> </div><div>Yes, indeed, it's another carrot.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Finally, both Debian/Ubuntu and Fedora are well advanced in their<br>
efforts to replace Python 2 with Python 3 in their respective default<br>
images (but keeping Py2 available in their package repos). That work<br>
is close to finished now (myself, Slavek Kabrda, Barry Warsaw, and<br>
Matthias Klose had some good opportunities to discuss that at PyCon),<br>
although there are still some significant rough edges to figure out<br>
(such as coming up with a coherent cross-platform story for what we're<br>
going to do with the Python symlink), as well as a few more key<br>
projects to either migrate entirely, or at least finish porting to the<br>
source compatible subset of Python 2 & 3 (e.g. Samba).<br></blockquote><div><br></div><div>Yes, at least from my professional experience, Python-Debian team has done an awesome job for that: It works like a charm.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Cheers,<br>
Nick.<br>
<span><font color="#888888"><br>
--<br>
Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
</font></span></blockquote></div><br></div></div>