maximum recursion depth?

John Nagle nagle at animats.com
Wed May 28 00:19:06 EDT 2008


alex23 wrote:
> On May 28, 9:26 am, globalrev <skanem... at yahoo.se> wrote:
>> is there a definitie limit to the nbr of calls or is the memory that
>> runs out? is that then the RAMmemory? is there a special amount of
>> memory assigned for python or it just takes and takes until windows
>> runs out of it?
> 
> You can alter the recursion limit using sys.setrecursionlimit:
> 
>     setrecursionlimit(n)
> 
>     Set the maximum depth of the Python interpreter stack to n.  This
>     limit prevents infinite recursion from causing an overflow of the
> C
>     stack and crashing Python.  

    The default is rather low.  I've actually hit it parsing big HTML
files with BeautifulSoup.

					John Nagle



More information about the Python-list mailing list