Add `PyDict_AsFrozenDictAndClear` C-API
Aperta
@sobolevn ci sta già lavorando.
Dal 9/7/2026.
interpreter-core
topic-C-API
type-feature
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Feature or enhancement
Discussion: https://discuss.python.org/t/provide-a-c-api-to-efficently-convert-dict-into-frozendict/107754/10
Looks like that all agree that this API would be useful.
How it works?
- We create a
dictby any existing C-API functions forPyDict_*. - Then we call
PyDict_AsFrozenDictAndClearwhich creates newfrozendictinstance from the existingdictwith O(1) complexity - It clears the initial
dictand it can be decrefed by the caller if needed
Linked PRs
- gh-153413
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.