This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Peter Ludemann
Recipients BTaskaya, Peter Ludemann, carljm, corona10, eric.snow, gregory.p.smith, gvanrossum, hroncok, vstinner
Date 2020-07-06.22:11:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594073478.6.0.0822266273665.issue40360@roundup.psfhosted.org>
In-reply-to
Content
Looking at the suggested successor tools (redbaron, libCST, parso, awpa) ... all of them appear to use some variant of pgen2. But at some point Python will be using a PEG approach (PEP 617), and therefor the pgen2 approach apparently won't work.

For a number of projects, it's important to have a parse tree that contains all the "whitespace" information (indent, dedent, comment, newline, etc.) As far as I can tell, the new PEG parser won't provide that, and it seems that none of the successor tools will be able to handle future versions of Python syntax.

So, three questions:
1. Am I right that all proposed replacements (redbaron, libCST, parso, awpa) use some variation of the LL(1) and therefore will have trouble in the future?
2. Are there any plans (either part of the core development or as a project) for one of these replacements that is PEG-based? (Or a new project?)
3. Is Lib/ast.py going to continue being supported? (I infer that it will, with the change from LL(1) to PEG being mostly transparent - https://mail.python.org/archives/list/python-dev@python.org/thread/HOZ2RI3FXUEMAT4XAX4UHFN4PKG5J5GR/#4D3B2NM2JMV2UKIT6EV5Q2A6XK2HXDEH )

If Lib/ast.py continues to be supported, I think I can see a way of providing functionality similar to lib2to3 (in terms of an AST-ish thing with "whitespace" from the source, sufficient for tools such as yapf, black, pykythe, pytype, mypy, etc.) as a kind of wrapper to ast.py. 
I suppose I should discuss this idea on python-dev? Is there an ongoing discussion? (I couldn't find any but might have been using the wrong search terms)
History
Date User Action Args
2020-07-06 22:11:18Peter Ludemannsetrecipients: + Peter Ludemann, gvanrossum, gregory.p.smith, vstinner, carljm, eric.snow, hroncok, corona10, BTaskaya
2020-07-06 22:11:18Peter Ludemannsetmessageid: <1594073478.6.0.0822266273665.issue40360@roundup.psfhosted.org>
2020-07-06 22:11:18Peter Ludemannlinkissue40360 messages
2020-07-06 22:11:18Peter Ludemanncreate