GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve `ast` CLI with new options: `--feature-version`, `--optimize`, and `--show-empty` · Issue #133367 · python/cpython

Improve ast CLI with new options: --feature-version, --optimize, and --show-empty #133367

New issue
Copy link
New issue
Copy link
Closed
Closed
Improve ast CLI with new options: --feature-version, --optimize, and --show-empty#133367
Copy link
Assignees
donbarbos
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@sobolevn
sobolevn
opened on May 4, 2025
Issue body actions

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 from parse
  • --show-empty from dump

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

  • gh-133367: Add missing options to ast CLI #133369

Activity

  1. sobolevn
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancementA feature request or enhancement
    on May 4, 2025
  2. donbarbos commented on May 4, 2025

    @donbarbos
    donbarbos
    on May 4, 2025
    Contributor
    More actions

    sure, i would be glad to implement it

  3. sobolevn
    assigned
    donbarbos
    on May 4, 2025
  4. sobolevn commented on May 4, 2025

    @sobolevn
    sobolevn
    on May 4, 2025
    MemberAuthor
    More actions

    awesome, tag me on PR - I will review it as soon as possible.

    Reacted by Semyon Moroz
  5. donbarbos
    added a commit that references this issue on May 4, 2025

    pythongh-133367: Add missing options to `ast` CLI

    783fb15
  6. sobolevn
    added a commit that references this issue on May 5, 2025

    gh-133367: Add missing options to `ast` CLI (#133369)

    2b4e2b7
  7. sobolevn
    closed this as completedon May 5, 2025
  8. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-133367: Add missing options to `ast` CLI (python#133369)

    f179f09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @donbarbos
    donbarbos

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.