[IPython-dev] Multiple outputs per input line

Thomas Kluyver takowl@gmail....
Mon Mar 14 12:04:34 CDT 2011


[Apologies, meant to post this to list. Thanks, Robert, for pointing it out]

On 14 March 2011 16:53, Thomas Kluyver <takowl@gmail.com> wrote:

> On 14 March 2011 16:39, Robert Kern <robert.kern@gmail.com> wrote:
>
>> 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:
>>
>
> At present, the Out variable in the user namespace is the same object as
> the stored output history from the current session. I think the best way is
> if I separate these.
>
>
>> 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 tried this, but it would need additional logic in Python to display the
> inputs and outputs in the right sequence. I prefer the system I've written,
> where (session, line) is unique, and the outputs for each command are
> serialised as JSON. Inputs and outputs are conveniently paired by SQL JOIN,
> and it's trivial to display them correctly.
>
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20110314/47b55e68/attachment.html 


More information about the IPython-dev mailing list