Act Now: Python 2 Series to Be Retired By April 2020

Python 2 Series Retiring
Estimated Reading Time: 3 minutes

Although Jan. 1, 2020, was the official date of Python 2’s retirement, the last major version is actually set for April 2020. After that date, development will cease for Python 2. 

Why is Python 2 retiring?

When Python was Guido van Rossum’s pet project, he didn’t anticipate its massive popularity. In 2000, he had a stronger vision with the Python 2 release, but its infrastructure still could not keep up with the magnitude of expansions, namely, types. New features were implemented by extending into the C/C++ code, but it was slow going and inefficient. Now that Python 3 is out and offering a variety of enhancements across the board, it’s not sustainable for the community to maintain two completely different architectures. By definition of what it is, Python 3 is not backwards compatible with Python 2.

Do I have to migrate? Can I keep using Python 2?

You don’t have to migrate. Compiled executables will still continue to run and installed libraries will remain as before. But Python 2 is now officially unsupported. The worst case scenarios for an unmigrated Python 2 program are either that the program won’t run on a future operating system, or that a future vulnerability goes undetected and unpatched.

What about Python 2.8?

In 2016 there were rumblings about Python 2.8 but it was never official. There won’t be one.

Will the old Python 2.X releases still be available?

Yes, and you can download all of the official Python releases at their website.

What’s this about April 2020 and Python 2.7.18?

Python 2.7.18 will be finalized and released in April 2020, but unsupported, as support for 2.X ended January 2020.

What should I be doing to prepare to migrate to Python 3?

If you haven’t already, give yourself a crash course on Python 3 and read up on the highlights and differences. Take some time to go through a shortlist of changed functions and make some notes if anything that you might have to change comes to mind. Next, go through your code and make sure that everything has adequate test coverage; if it doesn’t, consider a linter like pylint, or additional tools like coverage.py. The last piece of easier prep work is to run caniusepython3 and see where you stand and what libraries are going to be troublesome. If you aren’t up to date with 2.7, focus on that, and drop support for the older versions. At 2.7 you have the wide range of community tools available to you, like 2to3, which can translate your raw code. Or, you can use Futurize or Modernize to build a thin code wrapper over the old code. There’s also other options like the library six.

I can’t migrate to Python 3. Now what?

You’re not alone. There are other projects that will never migrate, like PyPI. You can consider freezing your code with container images like Docker. AWS’ Python Lambda will still offer 2.7 support as well as security patches, through the end of year 2020. You could also use a different Python interpreter, like CPython, but not everyone is willing to foray into this much work.

See Open Positions Now

Looking for an engineering career in tech? View the InfoTrust Careers page to apply.
Originally Published On January 28, 2020
October 8, 2020