-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Closed
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Current options:
» ./python.exe -m ast --help
usage: python.exe -m ast [-h] [-m {exec,single,eval,func_type}] [--no-type-comments] [-a]
[-i INDENT]
[infile]
positional arguments:
infile the file to parse; defaults to stdin
options:
-h, --help show this help message and exit
-m, --mode {exec,single,eval,func_type}
specify what kind of code must be parsed
--no-type-comments don't add information about type comments
-a, --include-attributes
include attributes such as line numbers and column offsets
-i, --indent INDENT indentation of nodes (number of spaces)
Basically, our CLI is an interface to ast.dump
+ ast.parse
, ast.parse
.
But, ast.parse
has several important options that are missing right now. I propose to add them:
--feature-version
- and
--optimize
fromparse
--show-empty
fromdump
Docs:
- https://docs.python.org/3/library/ast.html#ast.parse
- https://docs.python.org/3/library/ast.html#ast.dump
cc @donBarbos, will you be interested in working on this issue?
If not, please, tell me about that - I want to have this in 3.14 and the feature freeze is in several days.
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-featureA feature request or enhancementA feature request or enhancement