Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,212 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
1.7k
フォーク
156
平均マージ
8時間 31分
マージ済み PR(30日)
55

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/graalpython のほかの issue

oracle/graalpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。