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.

Author kj
Recipients Guido.van.Rossum, JelleZijlstra, docs@python, gvanrossum, kj, petr.viktorin, ronaldoussoren
Date 2021-06-14.18:04:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623693859.24.0.126171267485.issue44392@roundup.psfhosted.org>
In-reply-to
Content
> maybe it was a mistake to expose this

I was wondering if this was accidentally added at the time too.

> Remind me what use is made of this from C code

It's required for a C extension type to implement the __class_getitem__ method properly. Eg. ``MyCType[int]``. The other alternative is for them to import the types.GenericAlias Python constructor and call that, but that seems strange.

> Can we remove this from the stable API during beta? It was never exposed before.

Unfortunately, it seems like it has been (accidentally?) exposed since 3.9 :(. I see some 3rd party projects using it already, so I don't know if we can get rid of it so easily:
https://github.com/Nuitka/Nuitka/blob/57fecfe6cc939f4694b57d2efa37d1893c06b85b/nuitka/build/include/nuitka/helper/subscripts.h#L97

CC-ing Petr, seeking advice on the C stable ABI for this please.
History
Date User Action Args
2021-06-14 18:04:19kjsetrecipients: + kj, gvanrossum, ronaldoussoren, petr.viktorin, docs@python, Guido.van.Rossum, JelleZijlstra
2021-06-14 18:04:19kjsetmessageid: <1623693859.24.0.126171267485.issue44392@roundup.psfhosted.org>
2021-06-14 18:04:19kjlinkissue44392 messages
2021-06-14 18:04:19kjcreate