Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The system might use python for other task, making python 2. as default may bring issues. I remember that installing python 3 on a version of ubuntu an making a symbolic link /usr/bin/python to python3 wrecked apt and the updating system.


> making python 2. as default may bring issues.

Who's suggesting that you change the system default? If you want to make your python scripts run on a certain python version, set their shebang accordingly. Changing the default interpreter for system scripts because you want your scripts to run on a different version is crazy.

If your lamp is too bright, do you swap the transformer supplying the whole street's mains electricity supply for one with a different voltage and hope your neighbour's computer doesn't break, or do you turn your lamp down?


You can install both at the same time. "Default" here refers to what is installed by by default, and what the distro internal scripts are written in.

/usr/bin/python should remain symlinked to python2, and never python3: http://www.python.org/dev/peps/pep-0394/

But in any case, all scripts should reference the actual required version in the #! line.


The PEP actually says "recommended" and "for the time being" -- there's no mandate that it be done one way or another:

"For the time being, it is recommended that python should refer to python2 (however, some distributions have already chosen otherwise; see the Rationale and Migration Notes below)."


And this is why I cringe every time someone puts:

  #!/usr/bin/python
...at the top of their script instead of being specific like:

  #!/usr/bin/python2.6
Developers need to stop assuming that /usr/bin/python is a specific version!

As long as that's done, and the packaging is done right, there shouldn't be any major issues for the vast majority of programs.


Installing python 3 as default on current centos reportedly breaks yum.


<flamebait flavour="apt-get">Two birds, one stone?</flamebait>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: