Promote `PyUnstable_Object_GC_NewWithExtraData()` to the stable API
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Feature or enhancement
Proposal:
Allocating variable sized Python objects via the C API is a genuinely useful operation. It is e.g. needed to
- implement custom data structures (tuples, lists)
- implement binding libraries (like nanobind) that co-locate binding data structures with Python objects
So far, the standard way to create them was via PyVarObject, and this was supported even in stable ABI builds. Unfortunately, this data structure becomes inaccessible with the upcoming free-threaded flavor of the stable ABI.
I would like to propose that the function PyUnstable_Object_GC_NewWithExtraData() be promoted to the stable API to provide an escape hatch for extensions that require variable sized objects in abi3t. This will enable extensions to implement variable sized objects without depending on the specifics of PyVarObject.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-148499
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先閱讀 PyUnstable_Object_GC_NewWithExtraData() 的 C API 文件,以及 issue 中關於 PyVarObject、free-threaded 建置和穩定 ABI 的討論。當此函式被提升為穩定 API,且擴充功能可以在 abi3t 中將其用於可變大小物件時,工作就完成了。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, python
- 領域
- api
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100