[IPython-dev] Implementing inline images in a kernel

Thomas Kluyver takowl at gmail.com
Wed Jan 29 13:47:52 EST 2014


On 29 January 2014 00:09, Doug Blank <doug.blank at gmail.com> wrote:

> BTW, how does IPython get the last expression in a set of statements to be
> the return value? It can't be an eval(), because it can't handle
> statements, and it can't be exec() because it doesn't get the return
> value... the only thing it could be would be to parse the statements, and
> eval/exec each one?
>

That's pretty much what we do. Python makes it quite easy to parse the code
and inspect or manipulate the AST before compiling it.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140129/c8d1eafa/attachment.html>


More information about the IPython-dev mailing list