Skip to content

ast.Slice is no longer a subclass of ast.slice #84610

Closed

Description

@asottile
mannequin
BPO 40430
Nosy @serhiy-storchaka, @asottile, @isidentical, @iritkatriel

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-10-05.16:54:12.316>
created_at = <Date 2020-04-28.22:48:03.631>
labels = ['type-bug', 'library', '3.9']
title = 'ast.Slice is no longer a subclass of ast.slice'
updated_at = <Date 2020-10-05.16:54:12.316>
user = 'https://github.com/asottile'

bugs.python.org fields:

activity = <Date 2020-10-05.16:54:12.316>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = True
closed_date = <Date 2020-10-05.16:54:12.316>
closer = 'serhiy.storchaka'
components = ['Library (Lib)']
creation = <Date 2020-04-28.22:48:03.631>
creator = 'Anthony Sottile'
dependencies = []
files = []
hgrepos = []
issue_num = 40430
keywords = []
message_count = 4.0
messages = ['367571', '367584', '377185', '378066']
nosy_count = 4.0
nosy_names = ['serhiy.storchaka', 'Anthony Sottile', 'BTaskaya', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue40430'
versions = ['Python 3.9']

Activity

  1. asottile commented on Apr 28, 2020

    asottilemannequin
    MannequinAuthor

    unclear if this is intentional or not, I noticed this while seeing that ast.Subscript.slice is no longer Index / Slice / ExtSlice

    # python3.8

    >>> isinstance(ast.Slice(), ast.slice)
    True

    # python3.9a6

    >>> isinstance(ast.Slice(), ast.slice)
    False
  2. added
    3.9 (EOL)
    type-bug
    on Apr 28, 2020
  3. isidentical commented on Apr 29, 2020

    @isidentical
    SponsorMember

    This has been discussee and rejected (for certain reasonsons): #19056 (comment)

  4. iritkatriel commented on Sep 19, 2020

    @iritkatriel
    Member

    Looks like the answer is: it is a deliberate change, not a bug. Should this issue be closed?

  5. added
    stdlib
    on Sep 19, 2020
  6. serhiy-storchaka commented on Oct 5, 2020

    @serhiy-storchaka
    Member

    Even if make ast.Slice a (virtual) subclass of ast.slice it will not help much, because we cannot do it for ast.Index and ast.ExtSlice. ast.ExtSlice is not replaced with ast.Tuple, and any node type can now be used instead of ast.Index. The code that does isinstance() or issublass() check for ast.slice or one of its subcasses is now broken.

  7. 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.9 (EOL)stdlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions