[IPython-dev] [sympy] Treating Python 3 as a first-class citizen

Bradley M. Froehle brad.froehle at gmail.com
Tue Aug 6 01:59:59 EDT 2013

Hi Ondrej,

On Mon, Aug 5, 2013 at 9:05 PM, Ondřej Čertík <ondrej.certik at gmail.com> wrote:
> On Mon, Aug 5, 2013 at 9:24 PM, Aaron Meurer <asmeurer at gmail.com> wrote:
>> On Mon, Aug 5, 2013 at 1:40 PM, Thomas Kluyver <takowl at gmail.com> wrote:
>>> On 5 August 2013 19:32, Ondřej Čertík <ondrej.certik at gmail.com> wrote:
>>>> Though the PEP above says that eventually "python" should point to python
>>>> 3.
>>> Debian developers are strongly against ever making that change. It's
>>> possible that they'll change their minds in a few years, but I wouldn't bank
>>> on it.
>> They will change their minds. I thought that Arch was stupid making
>> "python" point to Python 3, but that was because at the time, no
>> libraries were Python 3 compatible. Nowadays, all major libraries are
>> compatible. In the future, Python 2 will be defunct, and it will be
>> stupid to never call Python "python".
> I think so too.

I have to think that this will eventually be the case as well,
but even very recent conversations [1] on the debian-python list
suggest that many outright reject the notion that `python` would
ever launch Python 3.

>> Once you switch to a single codebase, you start to see things
>> differently. Python 3 is just another version of Python. Supporting
>> Python 2.6 - 3.3 is no different than supporting Python 2.4 - 2.7.
>> The Python community made a big fuss about it, but I think that was a
>> mistake, and it has kept people from transitioning.
> Exactly. I recently wrote this blog post:
> http://ondrejcertik.blogspot.com/2013/08/how-to-support-both-python-2-and-3.html
> and I got a lot of feedback --- and unless I missed any, everybody
> agreed that "of course, single code base is the way to go" and "of
> course, Python 3.x is just another version of Python, with single code
> base there is no difference in supporting 2.6-2.7 or 2.6-3.3", as
> Aaron said.

I agree with the general sentiment that a single code base is
preferable.  In terms of the install process I'd expect that
eventually we'll just install a `ipython` script which uses the
same interpreter as during installation. Distributions which want
a ipython3.3 script can clean up what we do in post-processing.

As you mentioned, it's nearly impossible to develop using Python
3 in these projects which require 2to3 translation.  I struggled
with this a year ago when trying to develop IPython using Python
3.  Among other things, I ended up writing a rather crazy
'Runtime 2to3' [2] meta path hook which could do a (cached) 2to3
conversion on the fly.

We've discussed making IPython natively support 2.x and 3.x in
the same code base [3,4], and while I don't see it on the roadmap
[5], its probably in several developers' minds in the somewhat
distant future. At the moment the lack of unicode literal support
in Python 3.2 is pretty much a showstopper, but once we require
Python >= 3.3 I don't see a technical reason why we couldn't have
a unified code base.

In the mean time, we should continue the judicious examination of
issues like this one which improve Python 3 end user experience
because Python 3 is the future and we are all going to have to
migrate there eventually.

[1]: http://lists.debian.org/debian-python/2013/07/msg00052.html
[2]: https://github.com/bfroehle/rt2to3
[3]: https://github.com/ipython/ipython/wiki/IPEP-4:-Python-3-Compatibility
[4]: https://github.com/ipython/ipython/issues/2440
[5]: https://github.com/ipython/ipython/wiki/Roadmap:-IPython


More information about the IPython-dev mailing list