[IPython-user] IPython with Python 3.0
Mon Dec 8 09:37:13 CST 2008
On Mon, Dec 8, 2008 at 5:09 AM, Yannick Gingras <email@example.com> wrote:
> I like to use ipython when I do exploratory programming. For that
> very reason, I thought that reading the What's New in 3.0 document
> with ipython on my side would be great. I had no problem building
> ipython on 2.6 but given the scope of the syntactic changes, it don't
> think that it will be that easy to do the same with 3.0.
> Did anyone manage to run ipython on 3.0? Is there a branch somewhere
> with 2to3 pre-applied?
Just yesterday someone asked me the same question off-list, so I might
as well copy my reply here first (the question was, "when will there
be a py3 ipython"):
Honestly, I think it will take us a while. If you read:
you'll see step 0 being full test coverage, and we're only now working
our way up there. Things are much better now than before, but we have
a ways to go. It's also important to understand that ipython has a
'core' code that is terminal-only and has no dependencies beyond the
standard library, and additional code that uses Wx, Qt or Twisted for
various things (GUIs, networking, parallel programming, etc). The
core is actually probably fairly easy to port to 3.0, since it has no
C at all and the stdlib is all we need (besides nose for running
The latter will take much longer: Twisted is a key dependency in that
code and is a long way from being ported (you can scan recent posts on
python-dev by Glyph, its lead developer, to get a sense for things).
Twisted has a lot of C in it and complex dependencies, so don't expect
it to be ported overnight.
Given this reality, I disagree with the following part of the py3k
advice [edit: specifically for the case of ipython, not that I
disagree with this in general]:
It is not recommended to try to write source code that runs unchanged
under both Python 2.6 and 3.0; you'd have to use a very contorted
coding style, e.g. avoiding print statements, metaclasses, and much
I actually think that we might be able to do precisely the above,
simply by wrapping all our print statements in a function that behaves
like the new one. We don't use metaclasses nor much of the recent
fanciness, so all we need is for a codebase that *compiles* under 3.0,
not one that runs. At that point it will be possible to ship an
ipython which *installs* under 3.0 even though only its core (no guis,
no parallel computing) work. Since that core has a large user base,
this is a worthy goal, and it will put us in a position to begin
building for 3.0 as our dependencies for the extra functionality catch
Whether this is done by having a 2.6-3.0 single code or a 3.0 branch
into which we push all new 2.6-clean code will need to be fine tuned
with a bit of experimentation.
You can find more background here:
FWIW, I've been playing with ipython under 2.6.1 and aside from a
couple of harmless warnings, so far the basics seem to work fine. I
have yet to install nose, twisted and the rest under 2.6 so I haven't
run the test suite. So these results should be consider only
# End previous message
Right now we don't have a 3k branch in place yet. Given how easy it
is to make a branch in launchpad, anyone could get started with that.
It would be great to hear from someone who's willing to take a stab at
running 2to3 on ipython and then seeing what happens at least with the
If you do so, keep us posted.
More information about the IPython-user