bbcmicrobit / bbcmicrobit/PythonEditor
Blocks: "change <variable> by" block causes import error
Open
bug
- Dominant language
- JavaScript
- Stars
- 201
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
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:

Contributor guide
Assessment
This issue has not been assessed yet.