New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide how to handle displayhook being triggered multiple times #350
Comments
I think handling it in displayhook would lead to unexpected behaviour. Specifically, if I do Two possible ways to do this in AST side: we can run the last node interactively only if it's an expression, or we can run the last node which is an expression interactively, then switch back to exec mode for the remaining nodes. I think I would find the former behaviour less surprising (that is, only the last node can produce output). |
If people want to test it, here's a branch doing what I think is the most intuitive behaviour: |
Fernando and I tested this out and we really like the behavior. We On Sun, Apr 10, 2011 at 2:27 PM, takluyver
Brian E. Granger |
Actually, in its current state, the history can store any number of outputs, by sticking them into a JSON list. If we like this behaviour, I'll change that back so that it expects 0 or 1 output, and just stores it individually. |
Yes, Fernando and I talked extensively about this last night and think On Mon, Apr 11, 2011 at 2:43 AM, takluyver
Brian E. Granger |
I'll probably lose the JSON altogether, and just store the text/plain repr |
I think this sounds good. On Mon, Apr 11, 2011 at 10:39 AM, takluyver
Brian E. Granger |
Branch merged at bb38481, so I'm closing this issue. |
In IPython master, displayhook can currently be triggered more than one time per input. Previously we had talked about only allowing it to trigger once per input. We need to decide on the desired behavior and implement it. R. Kern brought up the good point that we don't need to handle this in the block splitter code, but could handle it in our custom displayhook code by allow the trigger to happen multiple times, but only showing the last result.
The text was updated successfully, but these errors were encountered: