Py_DEPRECATED should account for Py_Limited_API
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
Feature or enhancement
Proposal:
Take the example of Py_SetPythonHome().
It has been deprecated in 3.11, and we should now do things with PyConfig (added in 3.8).
But it is also part of the limited API. So it should not actually disappear, and someone building with Py_Limited_API<3.8 does not have the available symbols to use the non deprecated variant.
So every developer building with the limited API that cares about the warning will have to study each deprecated function, and if the non deprecated vairant is not in the stable API, add local deprecation warning disable code.
The proposal:
When Py_LimitedAPI is defined, Py_Deprecated should not trigger a warning if The deprecation version is greater than the limited API version selected by the macro (3.2 if the macro is empty, otherwise, the version value in Py_Limited_API), since we are really compiling for a lower version of python
I can probably do the PR myself if it is accepted
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先定位 CPython 標頭檔中 Py_DEPRECATED 和 Py_Limited_API 的定義與使用位置,接著以 Py_SetPythonHome 的宣告作為具體範例進行追蹤。檢查選定的 limited-API 版本如何影響棄用警告,並驗證只有在該 API 版本中無法使用替代項目時才會抑制警告。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100