python / python/cpython

IDLE: add a bytecode browser

オープン
#152,966 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stdlib topic-IDLE type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Completing the browser series alongside the token (#152941) and AST (#152942) browsers, seeing the disassembled bytecode helps in learning how CPython compiles code and in understanding what the interpreter actually executes.

I propose a Disassembly Browser added as an extension on the Tools menu (Shell and editor). It shows the disassembled bytecode of the current window. Each code object is a collapsible row of its instructions; nested code objects (functions, classes, comprehensions, ...) are shown as further rows.

Interaction:

  • Selecting an instruction highlights the corresponding source in the editor and, while the browser has focus, moves the cursor there.
  • The browser follows the editor: selecting text or moving the cursor selects the matching instructions.
  • Double-clicking a row (or pressing Escape) hides the browser, revealing the editor at that instruction.
  • Scope is the editor selection if there is one, else the Shell's current input, else the whole window.

While the debugger is stopped, the browser follows it instead of the editor: it shows the code object that is actually executing and marks the instruction the frame is stopped at.

It shares the window skeleton and editor-sync mechanism with the token and AST browsers.

A PR will follow.

Linked PRs
  • gh-152974

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず token ブラウザーと AST ブラウザー、それらで共有するウィンドウの骨格とエディター同期メカニズム、および関連付けられた PR gh-152974 を確認してください。issue のインタラクションとスコープのルールを受け入れ基準として使用してください: バイトコードはコードオブジェクト単位で参照でき、エディターまたはデバッガーと同期し、関連する命令まで戻って非表示にできる必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
desktop, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。