Add structured version info for decimal
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Feature or enhancement
decimal.__libmpdec_version__ (from mpd_version()) is the only information about the libmpdec library, and it only describes the library loaded at runtime. The version of the library that the module was built against is not exposed, although it can differ now that only a system libmpdec is used.
libmpdec provides MPD_VERSION, MPD_MAJOR_VERSION, MPD_MINOR_VERSION and MPD_MICRO_VERSION at compile time, and mpd_version() at runtime.
Add decimal.LIBMPDEC_VERSION and decimal.LIBMPDEC_VERSION_INFO for the build-time version, decimal.libmpdec_version as an alias of __libmpdec_version__, and decimal.libmpdec_version_info for the runtime version.
These names are specific to the C implementation and are not added to _pydecimal; the test which checks that both implementations expose the same names has to exclude them.
Linked PRs
- gh-157476
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先找出 decimal 的 C 實作和 _pydecimal 實作,然後檢查現有的 mpd_version() 和 libmpdec_version 處理方式。檢查要求兩個實作公開相同名稱的測試;當 C 實作公開所要求的建置時期和執行階段名稱,且一致性測試排除這些名稱時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, python
- 領域
- backend
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100