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.Slice is no longer a subclass of ast.slice #84610

Closed
asottile mannequin opened this issue Apr 28, 2020 · 4 comments
Closed

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

asottile mannequin opened this issue Apr 28, 2020 · 4 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@asottile
Copy link
Mannequin

asottile mannequin commented Apr 28, 2020

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']

@asottile
Copy link
Mannequin Author

asottile mannequin commented Apr 28, 2020

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

@asottile asottile mannequin added 3.9 only security fixes type-bug An unexpected behavior, bug, or error labels Apr 28, 2020
@isidentical
Copy link
Sponsor Member

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

@iritkatriel
Copy link
Member

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

@iritkatriel iritkatriel added the stdlib Python modules in the Lib dir label Sep 19, 2020
@serhiy-storchaka
Copy link
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.

@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-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants