[IPython-dev] Multiple outputs per input line

Fernando Perez Fernando.Perez at berkeley.edu
Mon Mar 21 14:32:42 EDT 2011


Hey guys,

On Mon, Mar 21, 2011 at 11:28, Thomas Kluyver <takowl at gmail.com> wrote:
> My best guess is that it's not actually a regression - I've seen code in
> run_cell that ensures that only one block in a cell can fire displayhook,
> which could be what has been described. But it doesn't affect the situation
> in which that block causes displayhook to fire several times. As far as I
> know, the only way to achieve that would be to catch things in displayhook,
> append them to a list, and then display them only after computation has
> finished.

sorry, I can't look into this until tomorrow...

Thomas, there should be code in there to prevent displayhook from
firing based on the compilation mode: when code is compiled in
'single' mode, displayhook will fire, but if it's compiled in 'exec'
mode, it won't.  There's actually different bytecode produced by
python itself based on the mode flag.

I thought I had made sure that for multiline blocks we always produced
'exec' mode, but something must have slipped through the cracks...

Cheers,

f



More information about the IPython-dev mailing list