[WIP] PEP 394: Allow not installing unversioned "python" command by encukou · Pull Request #893 · python/peps
The intended future for the ``python`` command is: > ``python`` doesn't exist and one always has to specify ``python2`` > or ``python3``. ( – Guido, python#630 (comment) ) There are three conflicting ideas around the ``python`` command, longer-term: 1. The ``python`` command should continue to refer to Python 2 (if Python 2 is available). 2. ``python`` is a correct shebang for py2/py3 source-compatible scripts. 3. Python 2 should *not* be available (by default / after 2010). One of these has to give. It seems that (2) is the easiest to shed, so this proposal does just that. * Make ``python3`` the 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 ``python`` command optional (along with ``idle``, ``pydoc``, and ``python-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" ``python`` command, encourage the use of explicit ``python2``/``python3``, and ease switching to systems that don't have Python 2 at all. * Clarify that distributions *should not* make unversioned ``python`` configurable. (That might work for carefully managed systems, but the ecosystem should converge on ``python3``, not "your ``python`` needs to be set properly".) * Remove mentions of choosing to link ``python`` to ``python3`` in the future, as we don't expect to start recommending that. * Use the term **"unversioned"** ``python`` when contrasting it with ``python3``/``python2``. I found that this makes the message much clearer.