Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> a = """
- ... def f(x):
- ... return x+1
- ... """
- >>> b = ast.parse(a, "<string>", "exec")
- >>> c = compile(b, "<string>", "exec")
- f_prime = convert_to_callable(c)
- f_prime(41) # expect to print 42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement