Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,212 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 分钟
30 天内合并 PR
55

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oracle/graalpython 的其他 Issue

查看 oracle/graalpython 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。