You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know how to fix it but it'll mean faffing about with the XML menu and creating a new block. It's probably also something that should be addressed in the "upstream" PyBlocks project run by the esteemed @carlosperate.
Yes, that is one of the disadvantages of blockly trying to generate "always valid" code, it sometimes end ups generating verbose and ugly code as well. One of the next things I wanted to do is extract the default blocks (for reasons of compability with blockly and scratch-blocks) and extend them or make them a bit more pythonic.
Taking in consideration we are going to find a few things like this I think the best way forward would be to overwrite the "change by" block generator in the microbit instance.
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:
See the following program as an example of failure:
![image](https://cloud.githubusercontent.com/assets/147113/24100039/2f15c360-0d6a-11e7-817b-1b5885706e2f.png)
The text was updated successfully, but these errors were encountered: