[Feature Request]: Emit expression tags for comparisons and their operands
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 54/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- backend, testing-qa
调研方向
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 内容生成。
描述
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)andnot (a is b), only the comparison result of the wholenotexpression is reported. Like CPython, GraalPy compiles them asa not in banda is not b, soa in bis never evaluated on its own. is Noneandis not Nonecomparisons are reported as well, including inifandwhileconditions.
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
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle/graalpython 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
oracle/graalpython#1213 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
oracle/graalpython#1105 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
oracle/graalpython#1102 ·
维护者通常 1 天内回复
-
bug
难度 3/5 半天 新手友好度 50/100
oracle/graalpython#1209 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 44/100
oracle/graalpython#1198 ·
维护者通常 1 天内回复
查看 oracle/graalpython 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
-
[Bug]: Importing weave changes the process-wide locale可能已有人在做 @himanshu748 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
-
UX
难度 1/5 1 小时以内 新手友好度 72/100
mediajunkie/piper-morgan-product#2008 · 2 条评论 ·