Add `PyDict_AsFrozenDictAndClear` C-API
Abierto
@sobolevn ya está trabajando en esto.
Desde el 9/7/2026.
interpreter-core
topic-C-API
type-feature
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.