Created
June 9, 2016 02:46
-
-
Save zackmdavis/8a7ff3c42a95fb7b01271ed26fe9cee6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in [1]: import ast; from ast import * | |
in [2]: m = ast.parse('def at(): print("@")') | |
in [3]: m.body[0].name = "@" | |
in [4]: exec(compile(m, "<string>", 'exec')) | |
in [5]: globals()['@'] | |
Out[5]: <function __main__.@> | |
in [6]: globals()['@']() | |
@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment