disp
disp copied to clipboard
Add an html repr for ASTs nodes.
🤔
Yeah, the following is not helpful:
Would be nice if you could collapse/expand...
Yeah, are you thinking a nested
details / summary tag
That expands to show more nodes?or something more like graphviz representation
Yeah, are you thinking a nested
details / summary tag
Yes.
Dag is interesting... but ast will be a tree anyway, so likely easier to represent explicitely.
+1
For an easier starting point, maybe add a text repr that pretty prints it? I use an ast pretty printer which I stole off someone's blog:
https://bitbucket.org/takluyver/greentreesnakes/src/96d6e70210789c0b743eabbbb57d9282b7e41d8c/astpp.py?at=default http://alexleone.blogspot.co.uk/2010/01/python-ast-pretty-printer.html
It doesn't have an explicit license, so we'd need to contact the author to clarify that before using it in IPython.