Labels

"Igbo Blues" 2006 2008 2010 Acceleration of proceedings Adamosa Osagiede Admissibility of oppositions Africa Musica African Divas African Fiesta Akwé Obiang Amharic Amunataba Dance Band Angèle Revignet Appeals : miscellaneous As I Lay Dying Bella-Bella Benga Bezawork Asfaw Biafra Bikutsi Bob Sir Merenge Bobongo Stars Bring Me The Horizon Bumba Massa Cameroun Canon Star cara mendapatkan uang Central African Republic Centro Mix Chelsea Grin Christy Essien-Igbokwe Claim interpretation Clarity CoC CoC akan Ditutup CoC ditutup Hoax CoC resmi ditutup CoC Tidak jadi ditutup Congo Correction of errors Côte d'Ivoire DDC Mlimani Park Orchestra Deathcore Desolation Of Eden Divisional application Douala Dr. Nico drone Dur Dur Ebenezer Obey Edo Efik Egwu Ekpili Elias Tababbal err errbot Ethiopia Ewi Ezigbo Obiligbo Faadumo Qaasim Fees Framework of appeal Francis Gon Gabon gaming gentoo Ghana golang Hausa Highlife Hilarion Nguema I.K. Dairo Igbo Igbo Traditional Music Info Itsiembu Bi-Mbin Jean-Boniface Asssélé Jerry Hansen Jezu Lokota Jo-Man Anguilet Josky Kiambukuta Juju Julien Nziengui Kenya Kiam Kosmos Moutouari l'ANPAC Presente Lanrewaju Adepoju Lapiro de Mbanga Late filing lego Leonard Dembo Libaaxyada Maaweeliska Banaadir Lingala linux Lipua-Lipua Mack Joss Makossa Mali Marcel Djabioh Marthe Ashagari Mayele Mbalax Mbaye Dieye Faye Melo Divine Metalcore Mike Ejeagha Miriam Makeba Mobanza Ley Musiki Mutuashi Muziki wa Dansi Nigeria Nigerian Female Vocalists Norbert Epandja Novelty Obiang Okane Oral proceedings Orchestra Cavacha Orchestre African Jazz Orchestre Veve Osayomore Joseph Other Blogs Ouaka Stars Partiality Patent Register Patrick Idahosa Personal musings Petit Tchadien Pierre Embony Pierre-Claver Zeng Pop Prior public use python Real Sounds of Africa Reimbursement review Rex Lawson Rigo Star Rock Sahra Dawo Santo Backita Senegal Shona Show Promoter Sierra Leone software development Somalia Soukous South Africa Stay of proceedings Substantial procedural violation Sufficiency of disclosure Suicide Silence Super Stars Swahili Sylvester Odhiambo Talents of Benin Tanzania Technical or not Teshome Asged Tips tmux Togo Toto Guillaume tutorial Verckys Vijana Jazz vim Waaberi Wolof Yoruba Yoruba Percussion Styles Yvon Dawens Z 3.1.01 Z 3.2.04 Z 3.2.07 Z 3.3.02 Z 3.3.03 Z 3.3.10 Z 3.5.01 Zambia Zimbabwe Zokela

!echo Bye-bye Python 2 !

In early 2013, we decided to port our chatbot project Errbot to Python 3. It was for its version 2.0.0beta.

I still remember that vividly, it was crazy at that time. First, absolutely nobody would use Errbot under Python 3. Finding compatible libraries was a gigantic pain not only for the plugin designers but also for ourselves: Check out this extract from the change log...

- xmpp backend has been replaced by sleekxmpp
- flask has been replaced by bottle (sorry flask no py3 support, no future)
- now the IRC backend uses the simpler python/irc package

We had to remove flask for rocket a small alternative and switch over the other 2 main dependencies we had for the 2 chat systems we supported. We barely wiggled through this ... and of course we broke stuff all over (I still have PTSD from the unicode breakages :) ).

2.0.0 stayed in beta for 10 months while users stayed safely on 1.7.1, a version from 2012.

We managed pretty well the next 3 years: the code was developed in Python 3 and translated automatically at install time to Python 2 with a tool called 3to2. The project grew in popularity and the general quality of the code, unit tests and documentation with it.

But something changed progressively, maintaining the Python 2 compatibility became more and more time consuming for not much benefit: simply less users were stuck with it. We could not find any reason for keeping the backward compatibility: all the main distributions have Python 3, the ecosystem moved on (even flask !), most plugins have the dual compatibility.

So today we pulled the plug, we are removing the Python 2 compatibility on master. We will maintain the backward compatibility for the latest version (4.2.x) until the end of the year while the new version will be Python 3.3+ only.

Some takeways

- It is quite impressive that, despite 3to2 making a very good job at converting the source code, a lot of hacks crept in over the years.  Just by browsing the diff, it is easy to see the jump in code readability.

- 3to2 was retrospectively the good choice: It allowed us to switch to the new Python version 3 years ago and today in just one long but very simple PR remove the support for the old one.

- 3 years ago it was definitely a little early to support Python 3 but today it is definitely the right time to drop Python 2.

If you have to port your project today, you are in luck ! You can drop Python 2 right away without all the complexity of maintaining a dual compatibility. Polish your test coverage, 2to3 in-place, fix it until it is done and enjoy the cleanliness and the new features of Python 3 without ever thinking again about Python 2.

0 Response to "!echo Bye-bye Python 2 !"

Post a Comment