Latest recipes tagged "recompile"http://code.activestate.com/recipes/tags/recompile/new/2012-12-01T08:59:49-08:00ActiveState Code RecipesCode to source and back (Python)
2012-12-01T08:59:49-08:00Oren Tiroshhttp://code.activestate.com/recipes/users/2033964/http://code.activestate.com/recipes/578353-code-to-source-and-back/
<p style="color: grey">
Python
recipe 578353
by <a href="/recipes/users/2033964/">Oren Tirosh</a>
(<a href="/recipes/tags/ast/">ast</a>, <a href="/recipes/tags/decompile/">decompile</a>, <a href="/recipes/tags/recompile/">recompile</a>, <a href="/recipes/tags/uncompile/">uncompile</a>).
</p>
<p>Converts a code object to a source code snippet and back: <code>c == recompile(*uncompile(c))</code></p>
<p>This is useful, for example, if you want to apply an AST transformation to the code.</p>