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

Allow ast.unparse to handle NaNs and empty sets #87687

Closed
Kodiologist mannequin opened this issue Mar 16, 2021 · 4 comments
Closed

Allow ast.unparse to handle NaNs and empty sets #87687

Kodiologist mannequin opened this issue Mar 16, 2021 · 4 comments
Labels
3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement

Comments

@Kodiologist
Copy link
Mannequin

Kodiologist mannequin commented Mar 16, 2021

BPO 43521
Nosy @rhettinger, @Kodiologist, @miss-islington, @isidentical
PRs
  • bpo-43521: Allow ast.unparse with empty sets and NaN #24897
  • [3.9] bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897) #24921
  • 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 2021-03-18.22:52:29.941>
    created_at = <Date 2021-03-16.19:39:06.673>
    labels = ['type-feature', '3.9', '3.10']
    title = 'Allow `ast.unparse` to handle NaNs and empty sets'
    updated_at = <Date 2021-03-18.22:52:29.940>
    user = 'https://github.com/Kodiologist'

    bugs.python.org fields:

    activity = <Date 2021-03-18.22:52:29.940>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-03-18.22:52:29.941>
    closer = 'pablogsal'
    components = []
    creation = <Date 2021-03-16.19:39:06.673>
    creator = 'Kodiologist'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43521
    keywords = ['patch']
    message_count = 4.0
    messages = ['388872', '388874', '389032', '389046']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'Kodiologist', 'miss-islington', 'BTaskaya']
    pr_nums = ['24897', '24921']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue43521'
    versions = ['Python 3.9', 'Python 3.10']

    @Kodiologist
    Copy link
    Mannequin Author

    Kodiologist mannequin commented Mar 16, 2021

    ast.unparse throws an error on an empty set, and it produces nan for NaN, which isn't a legal Python literal.

    PR to follow shortly.

    @Kodiologist Kodiologist mannequin added 3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement labels Mar 16, 2021
    @isidentical
    Copy link
    Sponsor Member

    The reason that we weren't support these cases was there were simply no way achieve them by parsing code so we simply ignored (empty sets etc). Though considering that you have a decent use case in hy, I'd agree that these small additions are viable.

    @miss-islington
    Copy link
    Contributor

    New changeset 08ff436 by Kodi Arfer in branch 'master':
    bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
    08ff436

    @miss-islington
    Copy link
    Contributor

    New changeset e8e3419 by Miss Islington (bot) in branch '3.9':
    bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
    e8e3419

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

    No branches or pull requests

    3 participants