3 ms·
The typical way to do that is to reuse the interpreter infrastructure. This hack could be done with the ast: https://docs.python.org/3.5/library/ast.html#ast.N
by maxerickson 12y ago
The typical way to do that is to reuse the interpreter infrastructure. This hack could be done with the ast:
https://docs.python.org/3.5/library/ast.html#ast.NodeTransformer https://docs.python.org/3.5/library/ast.html#ast.NodeTransfo...
- est 12y agoAST is cool, but you have to comply with Python's syntax. the coding way you can invent any wild syntax.
- maxerickson 12y agoI guess my first approach to that would not involve overloading the import statement.