Hacker News new | ask | show | jobs
by bbatha 3422 days ago
Except that python says that python 3 should be an executable named `python3` and `python` should refer to `python2` [0]

0: https://www.python.org/dev/peps/pep-0394/

3 comments

It says right in the pep

"...however, end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3..."

There was no guidance before the Arch devs made their choice. There's no reason to change back.

Especially since the goal is that python3 will be default eventually.

"...in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line."

There's a good reason to change back. There is now convention in place, and Arch's approach is obsolete.
It seems to me that Arch established their convention first, so why should Arch "change back" when they where first; why are others not "changing back" to Arch's convention, given that Arch's came first?

Well, the answer is that this is a silly discussion. Arch is doing what Arch is doing because Arch is intentionally forward oriented, sometimes to the detriment of backwards compatibility with the old school (and yes, a distro not having a symlink for python2 is at this point nearly 5 years into being "old school").

A particular convention has been adopted by nearly all distros, the Python project and the Python community. That convention is better than Arch's, because it is backwards-compatible with the large body of Python 2 code that exists.

Arch's change angered many in the Python community, and broke a lot of code. That Arch refuse to adopt the established convention, because it would involve admitting a mistake, shows a distinct lack of professionalism.

I don't understand why people always want to tell other people how to behave. The change was decided by Arch developers and impacted only the Arch distribution. Arch developers and Arch users did their job by adapting the Arch packages to work with this. I don't see any problem. If users don't like this choice, they are free to use any other distribution. If software developer don't like this choice, they are also free to not support Arch. And even this is not a problem most of the time because Arch users are doing the effort of adapting and packaging applications themselves on AUR.
> The change was decided by Arch developers and impacted only the Arch distribution.

Well, until developers that do their work on other distributions start getting bug reports as a result of Arch's unexpected naming convention. Should someone outside of the distribution expect Arch to change so that their software works there? No. Should Arch expect outside developers to adapt their code to work on Arch? No. Honestly, I'd expect the kind of people that Arch attracts to be used to dealing with little snags in operation, and for them to just dive in and fix it on their own.

Fair point. But Archlinux made the switch in 2010 [1], and this PEP was created in 2011.

[1] https://www.archlinux.org/news/python-is-now-python-3/

Using the official, graphical installer for Python 3 on Windows with no previous version installed creates an executable 'python' that refers to Python 3.

(Normally not a Windows user so I have no idea why this is the case or if by design.)

Windows doesn't support shebang lines, so the exact name/location of the interpreter doesn't matter as much as it does on 'nix.
Recent versions of python ship with a launcher shim for windows that does support the shebang line (to simplify using multiple interpreters):

https://www.python.org/dev/peps/pep-0397/

As you say though, it doesn't rely on the names of the exes.