Python 2 forever: 3 projects that will keep Python 2 alive

Python 2 faces official end-of-life in 2020, but it could hang around for those who still want it or need it

Python 2 forever: 3 projects that will keep Python 2 alive
US Navy

The switch from Python 2 to Python 3 has been rocky, but all signs point to Python 3 pulling firmly into the lead. It's broadly compatible with several libraries, a major third-party implementation of Python is keeping pace with version 3, and there's an encouraging rate of adoption by cloud providers for application support.

But there are still plenty of efforts to keep Python 2 alive in one form or another. In theory, there's no reason it can't happen. The default implementation of Python is open source, so it can easily be forked and maintained separately. Plus, nothing is keeping other implementations of Python from continuing Python 2 support on their own.

Here's how developers can carry the Python 2 torch well into the future—and reasons they won't.

Tauthon (aka Python 2.8)

Tauthon, originally labeled Python 2.8 but rechristened so as not to be confused with an official Python implementation, is one of the most straightforward efforts to keep Python 2 alive.

Tauthon is at heart a fork of Python 2.7.13, so existing Python 2.x software can run as-is on it. However, many of the most loved features from Python 3, such as async/await and keyword-only arguments, will be backported to it. But it will preserve one feature that's kept a lot of people faithful to Python 2 in the first place: print will remain a statement in Tauthon rather than a function.

PyPy

The PyPy runtime is popular because its built-in JIT provides major speed boosts to Python code. It also has long favored Python 2 over Python 3.

That favoritism isn't solely because the first versions of PyPy were Python 2 implementations and Python 3 has only recently entered the picture. It's also due to a key part of PyPy's ecosystem's, the RPython dynamic language implementation framework, foundation in Python 2.

That's not likely to change, according to PyPy's official FAQ. To that end, "the Python2 version of PyPy will be around 'forever', i.e. as long as PyPy itself is around." PyPy is yet another useful long-term fallback for the 2.x community.

Cython

Cython isn't a Python implementation, but rather a compiler—it converts Python to C, letting you use the programmer-friendly conventions of the former to get the speeds of the latter. Both Python 2 and 3 are supported, and based on word from the dev team, there's a good chance you'll be able to use Cython as an adjunct to Python 2 programs even after 2020.

"Cython's support for 2.x is driven primarily by project demand, not by Python's EOL schedules (though that would make the case stronger)," said Cython lead developer Robert Bradshaw in a post to the cython-users mailing list. "I can't predict what the landscape will look like 3+ years from now, but I don't anticipate removing support right away. Also, you can always use an older version of Cython if newer versions became Python 3 only. Support would look like it is now: best effort based on volunteers (on the mailing lists, stack overflow, github, etc.)"

Don't count on IronPython 

The dormant IronPython project implemented a Python runtime on the .Net framework's Common Language Runtime. It's since kicked back to life after project oversight was handed off to different team members, and work has been proceeding at a snappy pace to bring the project up to speed with Python 3.

What about Python 2? Alex Earl, one of the project's lead developers, isn't up for making it a priority. "I think we will have our hands full with Python 3 in the next few years," he wrote in an email, "so we'll focus mainly on that. We'd plan on EOL'ing our 2.x support at the same time as CPython does."

Again, nothing says the current IronPython3 project couldn't be forked by other developers and kept alive in a Python 2-compatible implementation. But don't look to the official IronPython dev team to do it.

Copyright © 2017 IDG Communications, Inc.