-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
This is either a feature request or a documentation bug.
I found in the Getting Started Developing wiki the following bullet point:
- You can parse a file and dump the parse tree by running mypy/parse.py as a script. This can make it easier to get familiar with the internals.
However that does not seem to be true; mypy/parse.py does not contain any code for running it as a script. In fact it used to have such code, but it was removed along with thousands of other lines when an old parser was taken out (see a8c7947). There was no mention of removing the script functionality in the PR (#2977) so I suspect it was an accident. Nobody seems to have missed it enough the past 2.5 years to raise an issue, but I'm just getting acquainted with mypy's internals and would like to have such easy access to the parse tree to help with debugging.
I propose one of the following fixes:
- Re-add the script functionality to
mypy.parse(I already have a commit ready: https://github.com/goodmami/mypy/commit/dddabd94762c5f762e3299b318b0d74e5cd57c10) - Add it under
scripts/(e.g.,scripts/dumpast.py) - Update the wiki
If people agree to (1) above, I'll go ahead and create the PR, or I can take care of (2) or (3).