Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,212 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
1.7k
Fork
156
Merge medio
8h 31m
PR unite (30g)
55

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oracle/graalpython

Tutte le issue di oracle/graalpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.