Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make python -m ast more configurable #82529

Closed
isidentical opened this issue Oct 2, 2019 · 8 comments
Closed

Make python -m ast more configurable #82529

isidentical opened this issue Oct 2, 2019 · 8 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@isidentical
Copy link
Sponsor Member

BPO 38348
Nosy @vstinner, @serhiy-storchaka, @ilevkivskyi, @isidentical
PRs
  • bpo-38348: Extend options of ast tool #16540
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-12-16.18:24:07.550>
    created_at = <Date 2019-10-02.15:14:59.536>
    labels = ['library', '3.9']
    title = 'Make python -m ast more configurable'
    updated_at = <Date 2019-12-16.18:24:07.549>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2019-12-16.18:24:07.549>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-12-16.18:24:07.550>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2019-10-02.15:14:59.536>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38348
    keywords = ['patch']
    message_count = 8.0
    messages = ['353741', '353830', '353842', '353972', '353990', '354414', '358502', '358503']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'levkivskyi', 'BTaskaya']
    pr_nums = ['16540']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38348'
    versions = ['Python 3.9']

    @isidentical
    Copy link
    Sponsor Member Author

    Allow user to set indent level and parsing status of type comments

    @isidentical isidentical added 3.9 only security fixes stdlib Python modules in the Lib dir labels Oct 2, 2019
    @serhiy-storchaka
    Copy link
    Member

    Why do you need this feature?

    @isidentical
    Copy link
    Sponsor Member Author

    I was checking typed_ast and i wanted to know which parts changed and
    implement that parts to astor. But there was no flags for --type-comments
    False.

    Also it can be handy to have an indention option to change it for fitting
    tree into the terminal width.

    On Thu, Oct 3, 2019, 11:45 AM Serhiy Storchaka <report@bugs.python.org>
    wrote:

    Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

    Why do you need this feature?

    ----------


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue38348\>


    @serhiy-storchaka
    Copy link
    Member

    Sorry, I do not understand you. typed_ast does not have such features as multiline dump() and CLI. What relation is this have with the --type-comments flag?

    As for fitting tree into the terminal width, the current indentation is 3 spaces. Changing it to 2 spaces will not save much horisontal space, and 1-space indentation is not particularly readable.

    I do not want to complicate this tiny feature. If you want more control on the output, you can write a small Python script which calls ast.dump() programmatically.

    @isidentical
    Copy link
    Sponsor Member Author

    I do not want to complicate this tiny feature.
    Making more configurable isn't making it complicated. It is just improving users control over it by indentation and parsing option.

    @ilevkivskyi
    Copy link
    Member

    I don't have any strong opinion either way, so it looks like we need to wait until someone else will ask for this.

    @vstinner
    Copy link
    Member

    New changeset 814d687 by Victor Stinner (Batuhan Taşkaya) in branch 'master':
    bpo-38348: Extend command line options of ast parsing tool (GH-16540)
    814d687

    @vstinner
    Copy link
    Member

    Thanks Batuhan Taşkaya.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants