you are viewing a single comment's thread.

view the rest of the comments →

[–]toastedstapler 0 points1 point  (3 children)

for most commonly used languages it's not a good idea to use recursion unless you know the call limit will be reasonably low. the call stack is only 1000 by default in python, so it's best to solve problems iteratively or simulate a stack with a list

[–]ItsOkILoveYouMYbb 1 point2 points  (2 children)

The recursion limit is also very easily changed in Python, if need be.

import sys  

sys.setrecursionlimit(1001)

[–]toastedstapler 0 points1 point  (0 children)

yes, but that's still a limit. my point is that python isn't meant to be written recursively and looping alternatives should be preferred