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

AST Unparser can't unparse ext slices correctly #83701

Closed
isidentical opened this issue Feb 1, 2020 · 4 comments
Closed

AST Unparser can't unparse ext slices correctly #83701

isidentical opened this issue Feb 1, 2020 · 4 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@isidentical
Copy link
Member

BPO 39520
Nosy @pablogsal, @miss-islington, @isidentical
PRs
  • bpo-39520: Fix unparsing of ext slices with no dimentions #18304
  • [3.7] bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304) #18940
  • [3.8] bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304) #18941
  • 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-04.19:45:25.492>
    created_at = <Date 2020-02-01.21:10:07.663>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7', '3.9']
    title = "AST Unparser can't unparse ext slices correctly"
    updated_at = <Date 2020-03-11.20:18:04.495>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-03-11.20:18:04.495>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-04.19:45:25.492>
    closer = 'BTaskaya'
    components = ['Interpreter Core']
    creation = <Date 2020-02-01.21:10:07.663>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39520
    keywords = ['patch']
    message_count = 4.0
    messages = ['361193', '363086', '363962', '363963']
    nosy_count = 3.0
    nosy_names = ['pablogsal', 'miss-islington', 'BTaskaya']
    pr_nums = ['18304', '18940', '18941']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39520'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @isidentical
    Copy link
    Member Author

    (this issue has already a PR for ast.unparse)

    >>> from __future__ import annotations
    >>> import ast
    >>> x: Tuple[1:2,] = 3
    >>> __annotations__["x"]
    'Tuple[1:2]'
    >>> ast.dump(ast.parse("Tuple[1:2,]"))
    "Module(body=[Expr(value=Subscript(value=Name(id='Tuple', ctx=Load()), slice=ExtSlice(dims=[Slice(lower=Constant(value=1, kind=None), upper=Constant(value=2, kind=None), step=None)]), ctx=Load()))], type_ignores=[])"
    
    >>> ast.dump(ast.parse("Tuple[1:2]"))
    "Module(body=[Expr(value=Subscript(value=Name(id='Tuple', ctx=Load()), slice=Slice(lower=Constant(value=1, kind=None), upper=Constant(value=2, kind=None), step=None), ctx=Load()))], type_ignores=[])"

    @isidentical isidentical added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Feb 1, 2020
    @pablogsal
    Copy link
    Member

    New changeset 185903d by Batuhan Taşkaya in branch 'master':
    bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
    185903d

    @miss-islington
    Copy link
    Contributor

    New changeset d0837d2 by Miss Islington (bot) in branch '3.7':
    bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
    d0837d2

    @miss-islington
    Copy link
    Contributor

    New changeset cd07b4d by Miss Islington (bot) in branch '3.8':
    bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
    cd07b4d

    @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.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants