[IPython-dev] Multiple outputs per input line
Mon Mar 14 11:39:16 CDT 2011
On 3/14/11 8:38 AM, Thomas Kluyver wrote:
> On 14 March 2011 10:59, Thomas Kluyver <firstname.lastname@example.org
> <mailto:email@example.com>> wrote:
> In fact, having thought about how I would do it, I'll code it up in a bit,
> and we can discuss a real system, rather than a hypothetical one.
> Right, that kept me occupied over lunch. Take a look at the code:
> Informal tests suggest that it's behaving as expected, but by all means pull the
> code and hunt for corner cases. If we're happy with this approach, I'll add some
> simple unit testing.
I really don't think we want the Out variable to have lists of things. That's
really annoying for the most common case and would break long-standing usage.
Having multiple displayhook calls is almost always an accident (e.g. usually you
make a function call for its side effects even if it returns something not
None), not an intentional act. I think the current behavior is perfectly fine:
In : for i in range(3):
In : Out
That said, for the recording of displayhook outputs in *history*, we may as well
record all of the the things sent to the displayhook. In the SQLite history, you
can do this by just using a dummy autoincrementing primary key for the table and
letting the (session, line) columns be non-unique.
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the IPython-dev