Ethan Furman wrote:
I think the key difference is that the AST is not going to be converted to run different Python code under Python, but under some other language -- presumably to implement the semantics of the Python snippet.
If the semantics were exactly the same as the Python snippet, there would be no need to convert it to another language -- you might as well just run the Python code as-is. The whole point of this kind of facility is to express things that you *can't* express the way you would like using standard Python semantics. From the user's point of view, it doesn't matter whether the implementation works by generating Python code, or generating some other language, or processing the AST directly. The effect is to assign non-Python semantics to Python syntax. (At least is *is* still Python syntax -- I can understand Guido being wary of letting people redefine the syntax as well.) -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com