python / python/cpython

IDLE: add a token browser

Abierto
#152,941 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

stdlib topic-IDLE type-feature
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Seeing how source is split into tokens helps in learning how Python's tokenizer works and in debugging tokenizer-dependent behavior, but IDLE offers no way to inspect the token stream.

I propose a Token Browser added as an extension on the Tools menu (Shell and editor). It shows the output of tokenize for the current window in a ttk.Treeview — one row per token with its type, string, and range.

Interaction:

  • Selecting a row highlights the corresponding source in the editor.
  • Double-clicking a row moves the editor cursor to that token.
  • The browser follows the editor: a selection selects every overlapping token row, and the cursor alone selects the single token containing it.
  • Scope is the editor selection if there is one, else the Shell's current input, else the whole window.

A PR will follow.

Linked PRs
  • gh-152946

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comience con la salida de tokenize de Python y el punto de entrada de extensiones de IDLE en el menú Tools para la Shell y el editor. Revise cómo un ttk.Treeview puede representar el tipo de token, la cadena y el rango, y luego verifique el comportamiento de selección, doble clic, cursor y ámbito descrito en el issue. Se considera terminado cuando el navegador sigue la ventana actual y asigna las filas de tokens a las ubicaciones del código fuente; gh-152946 está enlazado como el PR de seguimiento.

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
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.