python: RuntimeError: maximum recursion depth exceeded?
anonymous
1970-01-01 00:00:00 UTC
python: RuntimeError: maximum recursion depth exceeded?
Three answers:
?
2016-05-26 06:03:22 UTC
I'm guessing that Python has a limit on how deep recursive functions can be called. Each time a function is called, the status of the previous instance and all its variables etc. are pushed on a stack. So if there's a memory limit on the stack, or some word length limit, it would fail before you reach your count. Recursion is not a very efficient way of doing things, except maybe language parsers.
Namibnat
2009-12-08 23:27:15 UTC
Are you not using lists, dicts or tuples if you are working with Python? Are you not confusing your programming languages?
gitter1226
2009-12-08 22:44:42 UTC
Sounds to me like you have a faulty recursive function that does not exit properly. If you don't believe me, try creating a global numeric value, increment on every recursion and output to a console or file.
If you post some code, I could help you find your missed case.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.