Returning from a multiple stacked call at once

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Dec 12 18:52:50 EST 2020


On 13/12/20 5:46 am, ast wrote:
> Here is a code where it would be useful. This code looks for a
> path in a graph.

Recursion is probably not the best way to solve this problem in
CPython, because it imposes a limit on the number of nested calls
(in order to detect runaway recursion). By default the limit is
about 1000. So if you have a large graph with a path more than
1000 steps long, you can hit the recursion limit.

-- 
Greg


More information about the Python-list mailing list