Detecting recursion loops
Kay Schluehr
kay.schluehr at gmx.net
Sat Dec 2 12:24:32 EST 2006
Instead of threading a counter ( or an accumulator as for
tail-recursive functions ) you can monitor the behaviour of the mutual
recusive function call using an external stack and wrap the
contributing functions using a decorator s.t. pushing and popping to
and from the stack are pre- and postprocessing steps. Since the
external stack is under your control you can define fine grained limits
and actions.
More information about the Python-list
mailing list