bbcmicrobit / bbcmicrobit/PythonEditor

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

Aperta
#45 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
JavaScript
Stelle
201
Fork
126
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.