Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> it's working at the source code level rather than the AST level.

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.



Indeed; the goto hack works that way (and uses a decorator to make it easier to invoke the AST-manipulation logic).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: