[Python-ideas] Possible Enhancement to py Launcher - set default

Paul Moore p.f.moore at gmail.com
Wed Feb 7 04:14:37 EST 2018


On 7 February 2018 at 05:36, Alex Walters <tritium-list at sdamon.com> wrote:
> While this thread has focused on the location and means of managing py.ini,
> I think there is a more general solution that should be considered to the
> original problem, as described.  The problem isn't that it's difficult or
> non-obvious how to set the default python for the py.exe launcher (that's a
> possible documentation issue, and I argue a minor tooling problem), the
> problem is that the launcher, by default, selects the latest version of
> python as the default, regardless of that python's release status.  Without
> looking at the C code (I haven't but should), I don't think it would be too
> difficult to teach py.exe to not auto-select dev, alpha, or beta versions of
> python without being told explicitly to do so.
>
> For example (for the archives, this is written in February 2018, when 3.7 is
> in its beta), on a system with 3.6 and 3.7 installed...
>
>    py.exe myfile.py  REM should run 3.6, unless shebang overrides
>    py.exe -3.7 myfile.py REM should run 3.7 beta
>
> And after 3.7.0 final is released and installed on said system, py.exe
> myfile.py should run 3.7.
>
> Is this difficult to implement?  Is this a bad idea?

IMO the biggest technical issue with this is that as far as I can see
PEP 514 doesn't specify a way to determine if a given Python is a
pre-release version. If we do want to implement this (I'm +0 on it,
personally) then I think the starting point would need to be an update
to PEP 514 to include that data.

Paul


More information about the Python-ideas mailing list