[Python-ideas] Make py.exe default to Python 3
Paul Moore
p.f.moore at gmail.com
Mon Mar 14 19:01:21 EDT 2016
On 14 March 2016 at 17:18, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:
> I guess it's maybe just because this thread has made me realise that
> py.exe has changed purpose with respect to what it seemed (to me) to
> be before. When I was using Windows I used to always arrange for
> python and python3 to be available on PATH and I only used the "py"
> command as a way of explicitly selecting a particular non-default
> Python version. The idea that the default for py.exe needs to be
> python 3 suggests that people are now using "py" as the primary
> command line invocation of Python on Windows. I think is unfortunate
> as it takes Windows off in a different direction from every other OS.
> That intention wasn't the impression I had of PEP 397 at the time.
Indeed, it wasn't, and I would have always said that people should put
the version of Python that they want on PATH. Indeed, I still do that.
I don't think there's any "official" change in policy, nor is there a
groundswell of people using py.exe to invoke Python on the command
line. But PATH management remains messy and is probably even more so
now that per-user installs are the default (per-user PATH entries go
after system PATH entries on Windows, which makes the default
behaviour complex to describe, there's no way around that).
So using py.exe (which is always on PATH, and which gives access to
any Python) is possibly a more attractive option nowadays. I've
personally been experimenting with using it, and I've found that the
"Python 2 takes priority" behaviour is suboptimal for my interactive
use - this thread implies that I'm not alone in that. So I'll be
following up with a change to improve that default. That's all, as far
as I'm concerned.
But as for "the canonical way to run Python" - much less "the
canonical way to ensure you're running Python 3 (or 2)" - I don't
think there's any such thing, and honestly there never has been since
Python 3 came into existence and a proportion of the community needed
"python" to continue referring to Python 2, even though a newer
version had been released. If you (or anyone else) wanted to put
together a proposal for such a cross-platform standard way of
launching specific Python versions, then by all means go ahead. I can
imagine it would be immensely useful to have such a thing in a
teaching context. Personally it would be of no value to me, though, so
I'm not going to be interested in such a proposal.
I apologise if I gave the impression in this thread that there's any
sort of "official" change in advice on how to launch Python. As far as
I know, there hasn't been.
Paul
More information about the Python-ideas
mailing list