[WIP] PEP 394: Allow not installing unversioned "python" command#893
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The intended future for the
pythoncommand is:( – Guido, #630 (comment) )
There are three conflicting ideas around the
pythoncommand, longer-term:pythoncommand should continue to refer to Python 2 (if Python 2 is available).pythonis a correct shebang for py2/py3 source-compatible scripts.One of these has to give.
It seems that (2) is the easiest to shed, so this proposal does just that.
Make
python3the preferred shebang for py2/py3 compatible scripts, as that's the only shebang that'll work on py2-less systems. (An exception is made for scripts targetting the system Python on e.g. macOS/RHEL.)Make the unversioned
pythoncommand optional (along withidle,pydoc, andpython-config).Distributions now do not need to install it by default, even if Python 2 is installed. (But they should make it installable explicitly, as long as they ship Python 2.)
This should introduce more people to systems without the "legacy"
pythoncommand, encourage the use of explicitpython2/python3, and ease switching to systems that don't have Python 2 at all.Clarify that distributions should not make unversioned
pythonconfigurable. (That might work for carefully managed systems, but the ecosystem should converge onpython3, not "yourpythonneeds to be set properly".)Remove mentions of choosing to link
pythontopython3in the future, as we don't expect to start recommending that.Use the term "unversioned"
pythonwhen contrasting it withpython3/python2.I found that this makes the message much clearer.