On 21 May 2015 at 12:31, Guido van Rossum <gu...@python.org> wrote: > Hey Ben, this is probably a better topic for python-ideas. I'll warn you > that a hurdle for ideas like this is that ideally you don't want to support > this just for CPython. It's definitely cool though! (Using movie poster > style quotes you can turn this into a ringing endorsement: "definitely cool" > -- The BDFL. :-)
Agreed this is python-ideas territory, but yes there's definitely interest in being able to mark a section of code as being compiled to an AST object at compile time, and then further processed at runtime (essentially having syntax to switch on PyCF_ONLY_AST for a subexpression and/or entire statement). At the moment, you can do this all through the ast module and the PyCF_ONLY_AST flag to compile(), but you need to pass the code to be compiled around as strings, which tends to somewhat user (and IDE!) unfriendly. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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