You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ast.Slice is no longer a subclass of ast.slice #84610
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=Noneclosed_at=<Date2020-10-05.16:54:12.316>created_at=<Date2020-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=<Date2020-10-05.16:54:12.316>user='https://github.com/asottile'
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.
Activity
asottile commentedon Apr 28, 2020
unclear if this is intentional or not, I noticed this while seeing that
ast.Subscript.sliceis no longerIndex/Slice/ExtSlice# python3.8
>>> isinstance(ast.Slice(), ast.slice) True# python3.9a6
>>> isinstance(ast.Slice(), ast.slice) Falseisidentical commentedon Apr 29, 2020
This has been discussee and rejected (for certain reasonsons): #19056 (comment)
iritkatriel commentedon Sep 19, 2020
Looks like the answer is: it is a deliberate change, not a bug. Should this issue be closed?
serhiy-storchaka commentedon Oct 5, 2020
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.