IDLE: add a bytecode browser
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Revisa primero los navegadores de tokens y AST, su estructura de ventana compartida y el mecanismo de sincronización con el editor, así como el PR vinculado gh-152974. Usa las reglas de interacción y alcance del issue como criterios de aceptación: el bytecode debe poder explorarse por objeto de código, sincronizarse con el editor o el depurador y ocultarse de vuelta hasta la instrucción relevante.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- desktop, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100