[IPython-dev] Multiple outputs per input line

Fernando Perez Fernando.Perez at berkeley.edu
Mon Mar 21 14:55:25 EDT 2011


On Mon, Mar 21, 2011 at 11:39, Thomas Kluyver <takowl at gmail.com> wrote:
> A single block is compiled in single mode, regardless of how many lines it
> has. If there are several blocks, the last one is compiled in single mode if
> it is <= 2 lines long.

Ah, yes!  I remember now...

> However, even with a single line, you can do:
>
> for a in range(5): a

True.

The solution is technically easy, I guess we just need to decide a
policy.  I'd implemented the current one thinking it was a good
balance between seeing displayhook output in the most common cases and
not getting multiple ones otherwise. But we can certainly revisit
this.

And we could go back to always compiling in single mode, if we want.
Though that would trigger multiple Out[] results when running calls
like matplotlib plots, that are intended for their side effects but
still return a value.  That was  a big driver of deciding to silence
things somewhat...

best

f



More information about the IPython-dev mailing list