[sage-support] Re: maximum recursion depth exceeded in cmp

2009-03-31 Thread agi
Thanks, sys.setrecursionlimit(limit) works. On 26 Mrz., 16:39, William Stein wrote: > On Thu, Mar 26, 2009 at 5:24 AM, agi 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

[sage-support] Re: maximum recursion depth exceeded in cmp

2009-03-26 Thread William Stein
On Thu, Mar 26, 2009 at 5:24 AM, agi 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 SA

[sage-support] Re: maximum recursion depth exceeded in cmp

2009-03-26 Thread adrian
This is a dirty solution, but it might be interesting: It is possible to implement "tail recursion"; this would solve the problem for certain kinds of recursion; but will fail if the call is not a tail call, and I think this code won't work, but some variations would... I toss it as an idea: Th