Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Feature Request]: Emit expression tags for comparisons and their operands

Abierto
#1,212 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
54/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, python

Línea de trabajo

Start by reading the Bytecode DSL compiler code that creates expression tags and the PythonLanguage @ProvidedTags declaration. Trace how comparison operands and results are compiled, then run or add debugger coverage for the examples in the issue, including chained comparisons and is None conditions. Done means each specified operand and comparison result is reported once, with short-circuited operands omitted.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
Describe the feature

This request is to tag comparisons (==, <, in, is, chained comparisons, ...) and their operands with ExpressionTag. The tagged expressions should have their own source section.

Expected behavior

Stepping into expressions with SuspendAnchor.AFTER in

name = 'guest'
found = name in ('admin', 'guest')

should stop after each operand and after the comparison, with their source text and value:

Source text Value
name 'guest'
('admin', 'guest') ('admin', 'guest')
name in ('admin', 'guest') True

Other forms should behave like this:

  • In a chained comparison such as 1 < len(name) < 10, the middle operand is evaluated and reported once. When the chain stops early, the remaining operands are not reported.
  • A comparison used as an operand, as in (a == b) == c, is reported once.
  • For not (a in b) and not (a is b), only the comparison result of the whole not expression is reported. Like CPython, GraalPy compiles them as a not in b and a is not b, so a in b is never evaluated on its own.
  • is None and is not None comparisons are reported as well, including in if and while conditions.
Additional context

PythonLanguage lists StandardTags.ExpressionTag in its @ProvidedTags, but the Bytecode DSL compiler doesn't seem to tag such nodes with it, so Truffle tools won't find them. For example, a debugger session which steps with SourceElement.EXPRESSION won't stop there, so you can't see either the value or operands of the comparisons.

Lenguaje dominante
Python
Estrellas
1.7k
Forks
156
Merge medio
8 h 31 min
PR fusionados (30 d)
55

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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.

Más de oracle/graalpython

Todos los issues de oracle/graalpython

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.