[IPython-dev] Lineage graph for visible names

Thomas Kluyver takowl at gmail.com
Fri Jun 27 17:05:27 EDT 2014


On 27 June 2014 13:58, Mark Voorhies <mark.voorhies at ucsf.edu> wrote:

> If I wanted to take a crack at it, what are the best entry points for
> capturing object creation?


I can see two potential ways to do it:

1. Scan the AST for assignments when we execute cells. You can add an
ast.NodeVisitor instance to shell.ast_transfomers (docs here:
http://ipython.org/ipython-doc/dev/config/inputtransforms.html#ast-transformations
).

2. Run with the user_ns as a dict subclass that records on __setitem__. I
don't actually know whether the exec machinery will use that indirection,
or add items to the dict at a lower level that bypasses that.

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


More information about the IPython-dev mailing list