recursive function

Juho Schultz juho.schultz at helsinki.fi
Fri Oct 7 13:16:37 CEST 2005


mg wrote:
> Hello,
> 
> In a recursive function like the following :
> 
> 
> def foo( j ) :
>  j += 1
>  while j < n : j = foo( j )
>  return j
> 
> 
> in found that the recursivity is limited (1000 iterations). Then, I have 
> two questions :
> - why this mecanism has been implemented ?
> - it is possible to increase or remove (and how) the number of iterations ?
> 
> Regards,
> Mathieu

Try the following for answers to both questions:

import sys
print sys.setrecursionlimit.__doc__

I guess 1000 is the default value.



More information about the Python-list mailing list