[Microbit-Python] Max recursion depth limit

Radomir Dopieralski microbit at sheep.art.pl
Thu Feb 25 17:11:55 EST 2016


On Thu, 25 Feb 2016 23:07:48 +0100
Christopher Arndt <chris at chrisarndt.de> wrote:

> Am 25.02.2016 um 22:29 schrieb Damien George:
> > Yes, the recursion depth is really limited.
> 
> Ok, thanks for the explanation.
> 
> > The microbit is really limited on memory, so please don't expect too
> > much from it!
> 
> Yeah, I wasn't really aware that it so limited. Kinda stinks, but
> luckily there are enough other MicroPython boards out there.

Note that all implementations of Python (at least all that I am aware
of) witll raise this exception if you go too deep into the call stack.
I think CPython has this limit set to 100 by default, but you can
change it.

The reasoning behind this is that in the procedural programming style
that Python was created for, such deep recursion is usually a sign of
the code going wild, and not an intentional thing.


-- 
Radomir Dopieralski


More information about the Microbit mailing list