[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

Paul Sokolovsky report at bugs.python.org
Thu Dec 24 08:30:34 EST 2020


Paul Sokolovsky <pfalcon at users.sourceforge.net> added the comment:

> There is a considerable tension on exposed parts of the compiler pipeline for introspection and other capabilities and our ability to do optimizations. Given how painful it has been in the past to deal with this, my view is to avoid exposing as much as possible anything in the compiler pipeline, so we don't shoot ourselves in the foot in the future if we need to change stuff around.

That's somewhat extreme outcome when a problem is known and understood, but the best solution is deemed not doing anything.

But the problem of "doing it wrong" definitely known and exists. One known way to address it is to design generic interfaces and implement them. This ticket is exactly about that - defining a missing interface for a parser in Python. It's not about *the* CPython's C parser and its peculiarities. (But even it fits with the generic interface proposed.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42729>
_______________________________________


More information about the Python-bugs-list mailing list