[LLVMdev] Minimum Python Version

Sean Silva silvas at purdue.edu
Mon Dec 3 18:23:09 PST 2012

> several people already asked what are the concrete benefits of breaking support for end-of-life python versions?

Generally I think the only compelling argument is "for a given level
of maintenance effort, you either sacrifice support for old-dead
versions, or new versions", and obviously new versions should be
preferred. The question is how much does it cost to interoperate.

On Mon, Dec 3, 2012 at 7:01 PM, Tobias Grosser <tobias at grosser.es> wrote:
> Support for python 3 seems a good thing. What constructs in our code block
> the move to python 3?

I haven't looked in-depth at this, but just trying to import a couple
lit modules I get a lot of syntax errors like:

>>> import ShUtil.py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ShUtil.py", line 119
    raise ValueError,"Fast path failure: %r != %r" % (res, reference)
SyntaxError: invalid syntax

On this machine I have had to install python2 and symlink it in a
high-priority part of my PATH just to be able to run the test suite,
for example. Is this really any different than forcing people running
older versions to upgrade? The primary difference is that while the
number of people running older versions is declining, the number of
people running python3 will only increase.

I believe that 2.6 was the first version that had the __future__
import print_function available, which means that python 2.4 and 2.5
would not be able to use print statements if they are to interoperate
with py3k.

There is also __cmp__() which has been removed in python3 and I saw in
a couple places.

The bottom line is that basically every guide to
porting/interoperating with python3 starts with "step 1: use python
2.6 at least, ideally 2.7". Given the need to interoperate with py3k,
the need to get to 2.6 at least is compelling.

http://python3porting.com/preparing.html ("The first step in the
porting process is to get your code running in Python 2.6 or 2.7.")
https://wiki.ubuntu.com/Python/3 ("Target Python 3.2, 2.7, and
optionally 2.6. Ignore anything older than that.")
http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/ ("2.6 is
your Baseline")

It would be nice if whoever maintains lit (ddunbar?) would sit down
one day and try running it with python3 and just hammering out the

-- Sean Silva

More information about the llvm-dev mailing list