[Python-3000] should Python 3's executable install as 'python'?

Martijn Faassen faassen at startifact.com
Wed Mar 5 11:41:43 CET 2008


Hi there,

This is quick feedback given my experiences installing Python 3 for the 
first time. Take it as that, please.

I just installed Python 3 into my local installation directory, and 
noticed it installs as 'python'. I already had a local Python 2.4 
installed which I am actively using, and its 'python' was overwritten. 
This is normal behavior for the installation process, but Python 3 not a 
usual release.

Since Python 3 is not directly compatible with Python 2, overwriting 
'python' might lead to some confusion: people may have legitimate 
expectations that their python code remains working when they use 
'python', and scripts may be referring to it using #!. I started with 
the expectation that it wouldn't change the behavior of 'python' in my 
sandbox, but that expectation was wrong. :)

So the question is whether Python 3 should install itself as 'python' as 
well as 'python3.0'. It may be that this question should be answered 
differently now than it will be in a few years, depending on the rate of 
Python 3's adoption. A Python 3.1 or 3.2 might then be installed as 
"python" straight away.

A quick search on the topic found a  discussion about this in '05 
without a conclusion, and the following text in PEP 3000:

"Naming

Python 3000, Python 3.0 and Py3K are all names for the same thing. The 
project is called Python 3000, or abbreviated to Py3k. The actual Python 
release will be referred to as Python 3.0, and that's what "python3.0 
-V" will print; the actual file names will use the same naming 
convention we use for Python 2.x. I don't want to pick a new name for 
the executable or change the suffix for Python source files."

I suspect that the PEP section I quoted already answers my question in 
the form of "no", but it seems to leave some leeway given that it refers 
to the executable as "python3.0" in its example. I understand the 
long-term reason for letting 'python' be Python 3.x: "python" should 
invoke the most recent version of Python installed. It may still not be 
the best strategy to do this in the short term however, as while people 
have such an expectation, they also tend to have the expectation that 
their code will continue to run.

Python distributors such as Linux distributions will have to determine 
what 'python' does on their system. Some may choose to invoke Python 
2.x, some may choose Python 3.x. It might useful for the Python team to 
give some guidance on this, if possible, to try to avoid inconsistent 
decisions to be taken.

It would be nice if the motivation for the decision could be added to 
the PEP so we don't have others bringing up the same topic. This might 
also be a useful place distributors of Python could get their clues as 
to policy, though perhaps a "distributor's guide" might be useful.

Regards,

Martijn



More information about the Python-3000 mailing list