Multirelease effort: Moving to Python 3

Bohuslav Kabrda bkabrda at redhat.com
Tue Jul 23 06:40:56 UTC 2013


----- Original Message -----
> On Fri, Jul 19, 2013 at 08:20:02AM +0200, Marcela Mašláňová wrote:
> > On 07/19/2013 05:44 AM, Toshio Kuratomi wrote:
> > >
> > >On Jul 18, 2013 5:42 PM, "Michael Catanzaro" <mike.catanzaro at gmail.com
> > ><mailto:mike.catanzaro at gmail.com>> wrote:
> > > >
> > > > On Thu, 2013-07-18 at 09:53 -0700, Toshio Kuratomi wrote:
> > > > > /usr/bin/python should refer to python2 --
> > > > > http://www.python.org/dev/peps/pep-0394/  I'd be -1 to changing this
> > > > But when python2 is no longer installed by default, surely you want to
> > > > get a python prompt when you type 'python'?
> > >
> > >Yes, and for a long time, I'm going to want to get a python2 prompt.
> > >Which means installing the package for python2, not having python3 start
> > >on that case.
> > >
> > >
> > >
> > Why do you want to use old version as default? That's very
> > conservative approach for Fedora ;-)
> 
> This is the wrong mental model of the relationship between python2 and
> python3.  As a comparison this argument is akin to saying, "C is the old
> version of C++.  We should be porting all our code to use the C++ compiler
> in Fedora"  C is much more compatible to C++ than python2 is to python3 so
> this would be a less drastic change.
> 
> python2 and python3 are separate languages.  There is a lot of similarity
> between the two and with recent enough versions of python2 (2.7) and python3
> (python3.4) and some external libraries (python-six) and by sticking to some
> specific coding styles ( http://python3porting.com/noconv.html ) and by
> sometimes resorting to having separate files for some python2-specific
> routines vs python3-specific routines you can write code that is valid and
> runs under either language.  That does not mean that they are the same
> language.
> 

The problem is that you're basically saying "my mental model is the right one", which is not necessarily true for everyone (and not necessarily true generally). Taking your arguments a bit further, Python 2.6 and 2.7 are different languages too, since there are some backward incompatible additions to Python 2.7.

> > Upstream plans to support it until 2015 (maybe little longer). Fedora
> > needs to be prepared for such step, so it's the right time to start
> > working on it.
> > 
> I am wholeheartedly in favor of "working on it".  But things like switching
> the default /usr/bin/python are not "working on it".  Those are backwards
> incompatible, end user visible, changes of expectations that we do not need
> to implement now in order to be a leader.  When people invoke python, they
> expect python2.  When they want python3, they expect to type python3 to get
> that.  At the moment, causing /usr/bin/python to invoke python3 is just
> going to cause confusion and end user confusion (arch is the only linux
> distro that sets /usr/bin/python to point to python3).
> 
> As an example here, let's suppose that we were to stop shipping firefox by
> default and started shipping chromium instead.  Would we make
> /usr/bin/firefox invoke /usr/bin/chromium?  Would we have a firefox icon
> that started chromium when clicked?  When applied here, it does seem to make
> more sense for end user's to notice that there isn't a firefox icon and
> either consciously open up a different web browser or else install firefox
> to get their preferred browsing experience, right?  /usr/bin/python is the
> same way.  People have tons of scripts on their systems with
> #!/usr/bin/python shebang lines.  If we change /usr/bin/python to
> point to /usr/bin/python3 then we'll force them to deal with either porting,
> going through all their scripts and replacing them with /usr/bin/python2, or
> switching to another distribution which doesn't change the meanings of  well
> known interpreter paths for no gain.
> 

Again, this is all based on your "mental model" and on your assumption that it is the correct one. I just don't agree.

> All this is not to say that there might not be a time in the future when it
> makes sense to have python3 assume the /usr/bin/python name.  However, that
> time is *after* the collective user consciousness has stopped using
> /usr/bin/python, not before.  When we can go to pycon and talks are assumed
> to be targeting python3 rather than python2.  After people wanting to do
> a simple calculation on the CLI stop doing /usr/bin/python -c 'print 5 + 6'.
> This is probably after alternate python implementations like pypy and jython
> either die off or finally make the switch to implementing python3.  My guess
> is this will be after there's a RHEL release that includes /usr/bin/python3
> in the default install since RHEL and CentOS are major parts of our
> ecosystem and will have to be able to use the python3 syntax on both their
> RHEL servers and Fedora machines.  To some extent, this also depends on what
> other large distros set as their expectations: Debian and Ubuntu currently
> point /usr/bin/python to python2.  AFAIK, only Arch is pointing to python3.
> My intuition is this will be at least two years after we stop shipping
> /usr/bin/python (pointing to python2) by default but this could be wrong --
> it's about the expectations of the Fedora community and the Linux and python
> development communities as a whole.
> 
> -Toshio


-- 
Regards,
Bohuslav "Slavek" Kabrda.


More information about the devel mailing list