Navigation Menu

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

Keep ASDL signatures for AST nodes #83819

Closed
isidentical opened this issue Feb 15, 2020 · 2 comments
Closed

Keep ASDL signatures for AST nodes #83819

isidentical opened this issue Feb 15, 2020 · 2 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@isidentical
Copy link
Sponsor Member

BPO 39638
Nosy @benjaminp, @serhiy-storchaka, @pablogsal, @isidentical
PRs
  • bpo-39638: Keep ASDL signatures in the AST nodes #18515
  • 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 2020-03-16.08:21:03.641>
    created_at = <Date 2020-02-15.11:32:26.845>
    labels = ['type-feature', 'library', '3.9']
    title = 'Keep ASDL signatures for AST nodes'
    updated_at = <Date 2020-03-16.08:21:03.641>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-03-16.08:21:03.641>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-16.08:21:03.641>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2020-02-15.11:32:26.845>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39638
    keywords = ['patch']
    message_count = 2.0
    messages = ['362012', '364296']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'serhiy.storchaka', 'pablogsal', 'BTaskaya']
    pr_nums = ['18515']
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue39638'
    versions = ['Python 3.9']

    @isidentical
    Copy link
    Sponsor Member Author

    It would be super convenient to keep ASDL declarations in AST nodes. There are multiple benefits of it;

    1 -> When debugging or playing with the AST, time to time you may require to know what kind of things a field gets or is that field an optional one.

    2 -> The AST nodes are pretty limited on what can they do by default. For extending their scope, 3rd party tools often copy python's ASDL to their source and build custom AST nodes from that. And with knowing what every field gets they can automatically generate autotransformer codes from that ASDL spec which takes python's standard AST and convert it to their own AST nodes.

    We can either create a new attribute or keep this in the docstring. I think keeping this in the docstring can at least give some info about the node rather than None so it makes more sense to me. If the feature wanted, I can propose a PR.

    @isidentical isidentical added 3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 15, 2020
    @serhiy-storchaka
    Copy link
    Member

    New changeset 4ab362c by Batuhan Taşkaya in branch 'master':
    bpo-39638: Keep ASDL signatures in the AST nodes (GH-18515)
    4ab362c

    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants