[IPython-dev] Prefiltering input - where and how?

Thomas Kluyver takowl@gmail....
Sat Mar 12 12:45:27 CST 2011


Hi all,

Robert found that calling macros caused problems with my new history system,
and suggested that they be expanded by prefiltering, so that the translated
history stores the macro content each time it's called. My attempt to do
that is here:
https://github.com/takluyver/ipython/tree/expand-macro

However, I ran into trouble with the execution model - it seems to compile
the macro in "single" mode, so only the first line gets executed. So I
peered into the execution code, and ended up somewhat confused. I'm hoping
someone can clarify:
- How much preprocessing is (and should be) done by IPython.core.prefilter
versus IPython.core.inputsplitter?
- As far as I can see in the code, only a single line statement actually
gets passed to prefilter. Yet prefiltering still seems to be going on if I
enter a multiline block - and I'm not quite sure how
- Should prefiltering be in the frontend or the core? I'm guessing the core,
but there's some prefiltering code in the terminal frontend, although I
think it's dead, because:
- Why does TerminalInteractiveShell have two raw_input methods defined? I'm
guessing the first one is older code: can I delete it to simplify matters?
It's still there in version control if we need to refer to it.

Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20110312/f54c7f40/attachment.html 


More information about the IPython-dev mailing list