Allow `FrameType` to be instantiated
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
For some reason, FrameType is not allowed to be instantiated. This creates problems when trying to (for example) control an exception traceback, which is common for debuggers, among other uses. This is also inconsistant with most other internal types that exposed to Python and in the types module.
The only reason I can think of is because PyFrame_New requires a PyThreadState object, which is not exposed to Python. However, there are several ways around this:
- Run
PyThreadState_GetUnchecked, raisingRuntimeError(or another error) ifNULLis returned - Expose frames'
PyThreadStateto the interpreter - Pass another frame as a parameter, and get its thread state
This should be relatively trivial to implement and I can't think of any downsides, backwards compatibility concerns, or maintenance overhead. I can probably write a PR if one of the solutions to the thread state parameter is decided.
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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、FrameType のインスタンス化パスと、issue で名前が挙げられているエントリーポイント PyFrame_New および PyThreadState_GetUnchecked を確認します。インスタンス化でスレッド状態をどのように取得または検証すべきかを決定し、そのうえで、指定されている traceback とデバッガーのユースケースを壊すことなく Python から FrameType を作成できることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100