|
|
|
|
|
by zahlman
336 days ago
|
|
This one is arguably even more of a hack; it's working at the source code level rather than the AST level. The "coding" here is a bytes-to-text encoding. The Python lexer expects to see character data; you get to insert arbitrary code to convert the bytes to characters (or just use existing schemes the implement standards like UTF-8). |
|
this (lexing) is the only use of the codec hack - if you want to manipulate the AST you do not need this and can just to `ast.parse` and then recompile the function.