Thanks,
sys.setrecursionlimit(limit)  works.

On 26 Mrz., 16:39, William Stein <wst...@gmail.com> wrote:
> On Thu, Mar 26, 2009 at 5:24 AM, agi <agnes.j...@googlemail.com> wrote:
>
> > Hi,
> > I have a recursive algorithm that works well if it doesn't need more
> > than 5637 iterations.
> > In the case of more than 5637 iterations the error message is:
> > RuntimeError: maximum recursion depth exceeded in cmp
>
> > Is there a way to make SAGE execute it for more than 5637 iterations?
>
> This is a general Python question.  Searching for python and "maximum
> recursion depth" in google gives numerous pages with the answer, which
> is to call
>
>   sys.setrecursionlimit(limit)
>
> as documented here:http://docs.python.org/library/sys.html
>
> " Set the maximum depth of the Python interpreter stack to limit. This
> limit prevents infinite recursion from causing an overflow of the C
> stack and crashing Python.
>
>     The highest possible limit is platform-dependent. A user may need
> to set the limit higher when she has a program that requires deep
> recursion and a platform that supports a higher limit. This should be
> done with care, because a too-high limit can lead to a crash."
>
>  -- William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to