Add `PyDict_AsFrozenDictAndClear` C-API
Đang mở
@sobolevn đang làm issue này rồi.
Từ ngày 9/7/2026.
interpreter-core
topic-C-API
type-feature
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.