IDLE: add a bytecode browser
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Revise primeiro os navegadores de tokens e AST, seu esqueleto de janela compartilhado e o mecanismo de sincronização com o editor, além do PR vinculado gh-152974. Use as regras de interação e escopo da issue como critérios de aceitação: o bytecode deve poder ser navegado por objeto de código, sincronizar com o editor ou depurador e ser ocultado de volta até a instrução relevante.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- desktop, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100