bbcmicrobit / bbcmicrobit/PythonEditor

Blocks: "change <variable> by" block causes import error

未关闭
#45 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
201
派生
126
PR 合并指标
30 天内没有已合并 PR

描述

The 'change variable by' block causes the following import statement to be emitted:
```from numbers import Number```

Which in turn causes an ImportError on the device.

It also generates rather confusing code:
```
count = (count if isinstance(count, Number) else 0) + -1
```

See the following program as an example of failure:
![image](https://cloud.githubusercontent.com/assets/147113/24100039/2f15c360-0d6a-11e7-817b-1b5885706e2f.png)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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