Closed
Description
I ran into a Maximum recursion depth exceeded
error while developing on micropython on Windows. I was somewhat surprised as I did not think that my code was excessively complex.
I used the code from this forum post to test the recursion depth:
MicroPython v1.8.7 on 2017-03-02; win32 version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== a = 0
=== fail = False
=== def foo():
=== global a, fail
=== a += 1
=== if not fail:
=== try:
=== foo()
=== except:
=== fail = True
===
=== foo()
=== print(a)
12
>>>
It seems the recursion depth is 12 on Windows? Can that be right? How is it controlled? The same forum post mentions that on the Unix build, the recursion depth is 166. Even on the esp8266 it seems to be 19.
Metadata
Assignees
Labels
No labels