News for hackers. Stuff that matters.
Re:Fedora Linux will switch to Python 3 by default by jol on Thursday October 24, 2013 @06:39AM (#6604434)
Ok, so I'll state the obvious - it took almost 6 years from release of python 3.0.0 (2008-12-03)[1] till fedora adopting it. And I thought that cheap PHP hosts takes long time to upgrade PHP version.

Can someone with knowledge of python ecosystem explain what took a major distro so long, given that you could run different versions of python in parallel (or couldn't you?) for some of big pro software that needs the old version? [1] - http://python.org/download/releases/3.0/

Re:Fedora Linux will switch to Python 3 by default by jliechti1 on Thursday October 24, 2013 @06:52AM (#6604463)
You can see some reasons from one of the core developers here [0]:

"We (i.e. the Python core developers) predicted when Python 3.0 was released that it would take about 5 years for 3.x to become the "default" choice for new projects over the 2.x series."

He suggests the 5 year timeline begins in June 2009 with the release of 3.1 (since 3.0 still had many bugs) - so that means there is a little more than half a year left for it to become the default, if the prediction holds true.

The rest of his post goes into the issues in adopting Python 3.x.

[0]: http://programmers.stackexchange.com/questions/63859/why-do-...

Re:Fedora Linux will switch to Python 3 by default by vdaniuk on Thursday October 24, 2013 @07:05AM (#6604512)
Thanks for sharing this information. I am interested what strategies can be applied to increase the speed of language adoption.
Re:Fedora Linux will switch to Python 3 by default by bru on Thursday October 24, 2013 @08:07AM (#6604717)
> what strategies can be applied to increase the speed of language adoption.

In the case of Python 3, a neat thing library developers can do is write code that is both valid for Python 2 and Python 3. The six[0] library is a wrapper for making code compatible with both versions. There are tools like 2to3[1] and 3to2[2] that convert code from one version to another. They're not perfect but do catch the most common differences. Such things help with making the change.

However it is the availability (or more exactly lack of) of famous and widely used libraries that hinder or speed up the adoption. For example, Django recently started offering a Python 3 version[0]. Numpy and Scipy support it since around 2011 only.

0: http://pythonhosted.org/six

1: http://docs.python.org/2/library/2to3.html

2: https://wiki.python.org/moin/3to2

3: "Porting to Python 3" htthttp://pythonhosted.org/sixps://docs.djangoproject.com/en/de...

>Django 1.5 is the first version of Django to support Python 3. The same code runs both on Python 2 (≥ 2.6.5) and Python 3 (≥ 3.2), thanks to the six compatibility layer.

"Django's future, and Python 3" https://www.djangoproject.com/weblog/2012/mar/13/py3k/

Re:Fedora Linux will switch to Python 3 by default by 16s on Thursday October 24, 2013 @07:43AM (#6604633)
There are large working Python 2 code bases in a lot of organizations. It works great. Fabulously reliable. Extremely well-tested. Been running great for years. They have no desire or need to upgrade and will run Python 2 and pay devs to maintain it forever.

Welcome to the real world.

Re:Fedora Linux will switch to Python 3 by default by SeanDav on Thursday October 24, 2013 @08:54AM (#6604943)
You are right, just as there are still COBOL applications around.
Re:Fedora Linux will switch to Python 3 by default by andrewaylett on Thursday October 24, 2013 @08:00AM (#6604689)
It's not that it's not there -- Python 3 has been available on Fedora for years. It's that the system tools which use Python still use Python 2, which is itself still a modern, supported environment. TBH, I think it's probably correct for critical system scripts to be more conservative in upgrading.

It's also still going to be a while before Python 2 is actually removed, and while both are available the `python` executable will continue to point to Python 2.

If you don't ask for Python at the moment, you'll still get in your base install, because the system uses it. You get Python 2. In the future, you'll get Python 3 instead.

Re:Fedora Linux will switch to Python 3 by default by gnur on Thursday October 24, 2013 @07:11AM (#6604529)
One of the main differences with different PHP versions is that python 3 is not backwards compatible. Also, even after all these years, there are still quite some python projects that don't support python 3 (examples: mysqldb/twisted). Just switching the interpreter from 2 to 3 is surely something that will give a lot of headaches.
Re:Fedora Linux will switch to Python 3 by default by alcari on Thursday October 24, 2013 @07:34AM (#6604595)
No, PHP minor versions are not necessarily compatible with each other. When I worked in web hosting, we had to deal with quite a few issues resulting from changes between 5.2 and 5.3, and later 5.3 and 5.4.

At least Python has a sane versioning scheme, where breaking compatibility increments the major version number or is a bug.

Re:Fedora Linux will switch to Python 3 by default by deelowe on Thursday October 24, 2013 @09:25AM (#6605095)
I think the OP's point was that python 3 was never intended to be backwards compatible and intentionally broke compatibility in several places. For this reason, 2.7 continued to be supported for quite some time. I don't know a lot about PHP, but I'm guessing this was not the case for their minor version updates.
Re:Fedora Linux will switch to Python 3 by default by frenchy on Thursday October 24, 2013 @03:38PM (#6607401)
PHP changes were mostly, but not completely backwards compatible. There were a few corner cases were you'd get problems, but the majority of code would run fine on both systems.
Re:Fedora Linux will switch to Python 3 by default by sho_hn on Thursday October 24, 2013 @02:19PM (#6606913)
I think you may just be confused about the specifics of "adopting it".

Python 3 has been packaged and co-installable in Fedora for many years, and likewise a large number of Python 3 libraries are also packaged, and Fedora even put in quite a bunch of effort into tracking and increasing that number via porting efforts. And thanks to all of that, things are now getting ready to abandon Python 2 for the most core parts of the system itself.

So it's not like those six were spent idle, rather they were in the process of "adopting it" for much of those six years, and this is simply another milestone in that process.

If you were a user of the system and wanted to run something against Python 3, you could do that for a long time now. I've written plenty of Python 3 on Fedora systems using nothing but system packages.

Re:Fedora Linux will switch to Python 3 by default by shuzchen on Thursday October 24, 2013 @02:46PM (#6607099)
The switch isn't making python3 available; both python2 and python3 have been available for users for a long time. The switch means having the system tools rely on python3 rather than on python2, such that you can successfully install, boot, and configure a Fedora install without python2. This involved porting all the system code that uses python.

I suspect Archlinux's job was easy, because they had fewer system tools that utilized python. For example, Pacman (Arch's package manager) is written in C, whereas Yum (Fedora's package manager) is written in Python. Fedora also has other components that use python (the firewall frontend, some build/install/setup scripts), and "switching" to python3 involves porting over all of that.

Re:Fedora Linux will switch to Python 3 by default by qznc on Thursday October 24, 2013 @06:54AM (#6604472)
Twisted is one of the more important projects without Python3 support. This is their overview: http://twistedmatrix.com/trac/wiki/Plan/Python3
Re:Fedora Linux will switch to Python 3 by default by Tobu on Friday October 25, 2013 @06:26AM (#6610721)
Twisted is 99% ported and already packaged in Ubuntu: http://packages.ubuntu.com/raring/python3-twisted-experiment...
Re:Fedora Linux will switch to Python 3 by default by qznc on Thursday October 24, 2013 @06:59AM (#6604488)
The article provides a link to the TODO list: https://fedoraproject.org/wiki/User:Churchyard/python3
Re:Fedora Linux will switch to Python 3 by default by dancecodes on Thursday October 24, 2013 @06:42AM (#6604442)
gentoo?

python 3.2.5 there (and not so later) by default and you can run oldest versions in parallel also

Re:Fedora Linux will switch to Python 3 by default by jol on Thursday October 24, 2013 @06:48AM (#6604451)
ok, but what took so long for fedora? (in other comment I read about ubuntu waiting just almost 5 years) why?
Re:Fedora Linux will switch to Python 3 by default by dancecodes on Thursday October 24, 2013 @06:52AM (#6604466)
because is not actual and not main stream (it is about latest versions of python in distros)?

For ubuntu actual is window manager and good alternative desktop with usability, for Fedora maybe C development, for gentoo it is portage of course and their package manager powered by python.

Re:Fedora Linux will switch to Python 3 by default by fulafel on Friday October 25, 2013 @12:55AM (#6609838)
Python 3 was adopted in Fedora 13. 3.0 was not meant for production use (eg io library was pure python).