Skip to content

Fix ast.unparse() for subscription by extended slices and tuples #84070

Closed

Description

@serhiy-storchaka
BPO 39889
Nosy @serhiy-storchaka, @miss-islington
PRs
  • bpo-39889: Fix ast.unparse() for subscript. #18824
  • [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). #18826
  • [3.7] [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826) #18827
  • 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-08.10:44:34.333>
    created_at = <Date 2020-03-07.14:41:32.899>
    labels = ['3.7', '3.8', 'type-bug', 'library', '3.9']
    title = 'Fix ast.unparse() for subscription by extended slices and tuples'
    updated_at = <Date 2020-03-08.10:44:34.332>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-03-08.10:44:34.332>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-08.10:44:34.333>
    closer = 'serhiy.storchaka'
    components = ['Demos and Tools', 'Library (Lib)']
    creation = <Date 2020-03-07.14:41:32.899>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39889
    keywords = ['patch']
    message_count = 4.0
    messages = ['363596', '363601', '363602', '363605']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'miss-islington']
    pr_nums = ['18824', '18826', '18827']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39889'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. serhiy-storchaka commented on Mar 7, 2020

      @serhiy-storchaka
      MemberAuthor

      ast.unparse() produces incorrect output for ExtSlice containing a single element:

      >> print(ast.unparse(ast.parse('a[i:j,]')))

      a[i:j]

      It also produces redundant parenthesis for Index containing Tuple:

      >> print(ast.unparse(ast.parse('a[i, j]')))

      a[(i, j)]

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 7, 2020
    3. serhiy-storchaka commented on Mar 7, 2020

      @serhiy-storchaka
      MemberAuthor

      New changeset c4928fc by Serhiy Storchaka in branch 'master':
      bpo-39889: Fix ast.unparse() for subscript. (GH-18824)
      c4928fc

    4. serhiy-storchaka commented on Mar 7, 2020

      @serhiy-storchaka
      MemberAuthor

      New changeset 92b7278 by Serhiy Storchaka in branch '3.8':
      [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
      92b7278

    5. miss-islington commented on Mar 7, 2020

      @miss-islington
      Contributor

      New changeset 65b0310 by Miss Islington (bot) in branch '3.7':
      [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
      65b0310

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions