<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">On Sat, Jul 4, 2015 at 3:46 AM, Neil Girdhar <span dir="ltr"><<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thank you.  Has anyone implemented this solution yet?<span class=""><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 4, 2015 at 3:13 AM, Andrew Barnert <span dir="ltr"><<a href="mailto:abarnert@yahoo.com" target="_blank">abarnert@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Jul 3, 2015, at 13:42, Neil Girdhar <<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>> wrote:<br>
><br>
> There are a lot of messages in this discussion.  Was there a final consensus about how the AST for a given code object should be calculated?<br>
<br>
</span>I think it depends on what exactly you're trying to do, but using an import hook means you can call compile or ast.parse once and keep it around as well as using it for the compile, so that seems like it should be a good solution for most uses.</blockquote></div></div></span></div></blockquote></div><br></div><div class="gmail_extra">Yes, the MacroPy library uses this approach (import hooks to get and modify the AST):</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://github.com/lihaoyi/macropy">https://github.com/lihaoyi/macropy</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">-Bene</div></div>