[Python-ideas] Make py.exe default to Python 3

Paul Moore p.f.moore at gmail.com
Tue Mar 8 08:17:11 EST 2016


On 8 March 2016 at 11:22, Victor Stinner <victor.stinner at gmail.com> wrote:
> 2016-03-08 10:24 GMT+01:00 Paul Moore <p.f.moore at gmail.com>:
>> The "py.exe" wrapper on Windows runs the latest Python version
>> available on the user's PC, but it prefers Python 2 if the user has
>> both Python 2 and 3 installed. With Python 3.5 being released, is it
>> not about time that we switched that default to always prefer the
>> latest version available?
>
> On UNIX, it was decided to have python2 and python3 and don't guess
> user expectations.
>
> Why not providing an py3 runner which uses Python 3 by default?

I don't know. Personally, I don't like the versioned executables (will
we get a py4, py5,...?) but that's just a personal preference.

I believe that with an unversioned executable it should use the latest
version by default, and the point of my email is that I think we're
now at a point where special casing Python 2 is unreasonable,
particularly on Windows where there is no tradition of a "system
Python" which needs to be Python 2. If someone *else* wants to propose
replacing py.exe with py2.exe and py3.exe then they can do that (and
I'll be -1 on that proposal).

You don't mention the fact that an unadorned "python" command on Unix
typically invokes Python 2. As far as I know the only reason that was
needed was because system Python scripts were written that way, back
before Python 3 was around, and couldn't be updated to be Python 3
compatible. That reason doesn't apply on Windows. And on Windows,
"python" has always referred to the currently active version of
Python, whether 2 or 3.

tl; dr; I'm against making the unversioned name "python" (or "py")
forever mean Python 2. There are justifications for it on Unix, but
none of those apply on Windows.

Paul


More information about the Python-ideas mailing list