|
|
|
|
|
by p4wnc6
3863 days ago
|
|
This still doesn't make it easy to understand how it is executing. Is there a hook on import that detects the file in which it's imported, searches for the # coding language pragma line, and then actually alters the text of the source code before the Python interpreter resumes parsing the rest of that file? Initially I thought this was something like James Powell's "astexpr" literals example (towards the end of < http://www.youtube.com/watch?v=2O7yj-Nh6AY >), which would require actually implementing a new C-API type, adding parser logic for its literals, and recompiling Python. If you can add a comment or two to clear up my confusion, I would really appreciate it. Great work on this! |
|
'[$qq|this is the body|]'.encode('utf-8').decode('quasiquotes') "qq._quote_expr(0,' this is the body')"