-
- Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Following https://github.com/ericsnowcurrently/multi-core-python/wiki/0-The-Plan we need to convert the itertools
extension module to use module state.
There are multiple static global type objects:
cpython/Tools/c-analyzer/cpython/globals-to-fix.tsv
Lines 338 to 359 in e244401
Modules/itertoolsmodule.c-_grouper_type- | |
Modules/itertoolsmodule.c-accumulate_type- | |
Modules/itertoolsmodule.c-batched_type- | |
Modules/itertoolsmodule.c-chain_type- | |
Modules/itertoolsmodule.c-combinations_type- | |
Modules/itertoolsmodule.c-compress_type- | |
Modules/itertoolsmodule.c-count_type- | |
Modules/itertoolsmodule.c-cwr_type- | |
Modules/itertoolsmodule.c-cycle_type- | |
Modules/itertoolsmodule.c-dropwhile_type- | |
Modules/itertoolsmodule.c-filterfalse_type- | |
Modules/itertoolsmodule.c-groupby_type- | |
Modules/itertoolsmodule.c-islice_type- | |
Modules/itertoolsmodule.c-pairwise_type- | |
Modules/itertoolsmodule.c-permutations_type- | |
Modules/itertoolsmodule.c-product_type- | |
Modules/itertoolsmodule.c-repeat_type- | |
Modules/itertoolsmodule.c-starmap_type- | |
Modules/itertoolsmodule.c-takewhile_type- | |
Modules/itertoolsmodule.c-tee_type- | |
Modules/itertoolsmodule.c-teedataobject_type- | |
Modules/itertoolsmodule.c-ziplongest_type- |
We need to convert these to heap types, add module state, and implement multi-phase init.
See also PEP-687.
I've got an old PR (#24065) that I'm planning on resurrecting. I'll re-submit it as multiple PRs; this is going to be a large change.
For this particular module, it could make sense to add a module state pointer to each type context, for easy and cheap state access.
Linked PRs
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement