[IPython-dev] IPython on PyPy

Thomas Kluyver takowl@gmail....
Mon Aug 22 15:57:39 CDT 2011

On 22 August 2011 20:15, Thomas Kluyver <takowl@gmail.com> wrote:

> On 22 August 2011 20:03, Fernando Perez <fperez.net@gmail.com> wrote:
>> though for me, at least *some* parts of readline do work with 0.10.2.
>> I've tested with pypy1.6 on a 0.10.2 virtualenv, and I get reasonable
>> tab completion and arrows/cursor handling.  History reverse search
>> with Ctrl-r also works, though not the more basic up-arrow behavior we
>> also enable.
> OK, that's interesting. My message to pypy-dev bounced (only subscribers
> can post), so I'll have a play around and see if I can work out where the
> difference comes from.

Worked it out, after some confusion. PyPy's readline module works by
replacing the stock raw_input function, but that only happens after we've
saved a reference to the unmodified raw_input, which we do precisely to
defend against things replacing raw_input.

I think the best way to do it is to move our saving of raw_input_original
from import time to the instantiation of InteractiveShell, just after
init_readline is called. I've just pushed a commit doing this to my
pypy-compat branch (PR 722).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20110822/e03c830c/attachment.html 

More information about the IPython-dev mailing list