expressions in blocks don't print their value in the REPL

未关闭
#2,527 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
cli

调研方向

在 RustPython REPL 中重现这两个代码片段,并跟踪 for 和 with 块中的表达式是如何求值和显示的。完成标准是:对于循环,REPL 打印 0 到 9;对于 f.write('hello'),REPL 打印 5,与 CPython 示例一致。

由索引模型根据 Issue 内容生成。

描述

Try the following snippets:

for i in range(10):
    i

with open('/tmp/file.txt', 'w') as f:
    f.write('hello')

In CPython:

>>> for i in range(10):
...     i
... 
0
1
2
3
4
5
6
7
8
9
>>> with open('/tmp/file.txt', 'w') as f:
...     f.write('hello')
... 
5
>>>

In RustPython:

>>>>> for i in range(10):
.....     i
..... 
>>>>> with open('/tmp/file.txt', 'w') as f:
.....     f.write('hello')
..... 
>>>>> 
主要语言
Rust
星标
22.4k
派生
1.5k
平均合并
15 小时 18 分钟
30 天内合并 PR
172

贡献指南

打开贡献指南

从这里开始

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

RustPython/RustPython 的其他 Issue

查看 RustPython/RustPython 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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