5 ms·
> Otherwise, whatever $ which python will be the default. This is a bit strange because the python binary is always supposed to be Python 2. The Python 3 binar
by JeremyBanks 10y ago
> Otherwise, whatever $ which python will be the default.
This is a bit strange because the python binary is always supposed to be Python 2. The Python 3 binary is supposed to be named python3. Some distributons don't follow this, but they're the weird non-conformant ones; it's not a behaviour that should really be relied on.
- jjawssd 10y agoIsn't `python` in Ubuntu a Python 3?
- anuragsoni 10y agoNot yet. At least on ubuntu 16.10 python still defaults to `python2`
- jacobmischka 10y ago> always supposed to be Python 2 This is not correct. It's a symlink to python2 on systems that rely on calls to python to be python2. On modern systems, python is usually a symlink to python3. This is the case on Arch Linux and I believe other recent distro releases.
- JeremyBanks 10y agoArch is the oddball. I'm not aware of anybody else who's made the switch. Given that they're not mutually compatible except in rare cases, it's a very silly thing to do. You can upgrade GCC with the same name because you know it will handle most of the same input. If you do that with Python you're breaking tons of existing scripts for very close to zero benefit. Why would you do that?
- baq 10y agoI'm pretty sure Ubuntu 16.04 is Python 3 by default and you have to ask for 2. edit: nope, been imagining things. too much time in venvs i guess. need to get more sleep :)
- jacobmischka 10y agoIt's not silly. One of Arch's primary draws is being the first to get updates and integrate new technologies. Other distros will follow soon enough if there really aren't any others. It's not as if python2 suddenly doesn't exist, it's not terribly life-changing to add a 2 in the places where the scripts are still on the last version. I'm glad to be on a system where the default Python version isn't one that will be officially unsupported in three years. Edit: It's worth pointing out that this switch was made 6 years ago and the world is still spinning. https://www.archlinux.org/news/python-is-now-python-3/ https://www.archlinux.org/news/python-is-now-python-3/
- JeremyBanks 10y agoThey can adopt Python 3 and drop Python 2 without adding this link which encourages a convention of /usr/bin/env python for Python 3 on their platform, creating unnecessary incompatibility with other platforms. As you said, it's old news now, and not the end of the world. But I'm hoping others don't follow.
- kyrias 10y agoNon-conformant? PEP-394 says that scripts should only use python in the shebang if it's compatible with both py2 and py3, and be updated to work with both, or to use python2 otherwise.
- JeremyBanks 10y agoHuh. https://www.python.org/dev/peps/pep-0394/ https://www.python.org/dev/peps/pep-0394/