<div class="gmail_quote">On 8 April 2011 19:19, Brian Granger <span dir="ltr"><<a href="mailto:ellisonbg@gmail.com">ellisonbg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div id=":15k">But hold on a second.  I thought that we had made the decision that<br>
display hook was never to be triggered twice for a given input cell.<br>
Has that changed?  A few weeks ago, the code had regressed into the<br>
multiple display hook being called state, but I thought that was a bug<br>
we were going to fix.<br>
<font color="#888888"><br>
Brian</font></div></blockquote><div><br>I think we worked out that what had actually been written was code to ensure that only one block per cell (the last one) was able to produce output. But if that block was, say "for a in range(5): a", it could still produce multiple outputs. As far as I know, we've never prevented that.<br>

<br>In fact, now that we're using AST instead of code blocks, we could actually do what you suggest. We could check the last node, and only run it interactively if it was a single expression. Whether or not that's what we want to do, I don't know: any views?<br>

<br>Thomas<br></div></div>