please, consider the following code
for foo in range(10):
--print(foo)
--for bar in range(10):
----pass
--else:
----continue
--break
in a full-blown python the result is a sequence of numbers 0 through 9, micropython terminates at number 0. i am not sure if this is a micropython implementation, known issue or something else but i wonder if anyone sees something similar.
micropython is v1.8.5 on esp8266.
weird behaviour breaking from a nested loop
-
- Posts: 3
- Joined: Tue Jun 20, 2017 7:40 pm
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: weird behaviour breaking from a nested loop
I can replicate this on the Unix build of MicroPython. I agree that the behaviour is wrong so it does appear that you've uncovered a bug. I'll raise an issue on GitHub.
[EDIT]
See https://github.com/micropython/micropyt ... -309975195
[EDIT]
See https://github.com/micropython/micropyt ... -309975195
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: weird behaviour breaking from a nested loop
This issues has been fixed in the latest version of the code.