python / python/cpython

PyCode_Addr2Line point to out of date PEP 626

未關閉
#156,725 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-C-API
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Documentation

The docs for PyCode_Addr2Line say:

For efficiently iterating over the line numbers in a code object, use the API described in PEP 626.

That section of the PEP describes PyCodeAddressRange, PyLineTable_InitAddressRange, PyLineTable_NextAddressRange, and PyLineTable_PreviousAddressRange . Those function have been renamed with a _ prefix. Some are not exported symbols (even in private headers). That's fine for the PEP, we treat them as historical documents, but the docs should be up to date.

Ideally we:

  1. Document that PyCode_Addr2Line may be O(N) in the size of the code. This is important and not obvious!
  2. Describe how to iterate efficiently in the docs.
  3. In a future version of Python, expose the functions as public, documented, unstable C APIs. (I think PyUnstable makes sense for these)
Linked PRs
  • gh-156736

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 PyCode_Addr2Line 文件開始,將其中對 PEP 626 的參照與 issue 中描述的重新命名後位址範圍函式進行比較。先檢查連結的 PR gh-156736;當複雜度說明和有效率的反覆運算指引準確無誤,且任何未來的 API 公開都被明確分開時,文件工作即告完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
api, documentation
Issue 類型
文件
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。