This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ast.Slice is no longer a subclass of ast.slice
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Anthony Sottile, BTaskaya, iritkatriel, serhiy.storchaka
Priority: normal Keywords:

Created on 2020-04-28 22:48 by Anthony Sottile, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg367571 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2020-04-28 22:48
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)

# python3.9a6

>>> isinstance(ast.Slice(), ast.slice)
msg367584 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-04-29 00:07
This has been discussee and rejected (for certain reasonsons):
msg377185 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-19 19:17
Looks like the answer is: it is a deliberate change, not a bug. Should this issue be closed?
msg378066 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-10-05 16:54
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.
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84610
2020-10-05 16:54:12serhiy.storchakasetstatus: open -> closed
resolution: wont fix
messages: + msg378066

stage: resolved
2020-09-19 19:17:38iritkatrielsetnosy: + iritkatriel
messages: + msg377185
components: + Library (Lib)
2020-04-29 00:07:15BTaskayasetnosy: + serhiy.storchaka, BTaskaya
messages: + msg367584
2020-04-28 22:48:03Anthony Sottilecreate