"LOPEZ GARCIA DE LOMANA, ADRIAN" <[EMAIL PROTECTED]> writes:
> Hi all, > > I have a question with some code I'm writting: > > > def main(): > if option == 1: > function_a() > elif option == 2: > function_b() > else: > raise 'option has to be either 1 or 2' > if iteration == True: > main() [...] > I want an infinite loop, but after some iterations (996) it breaks: Since no one else mentioend it: this is only iteration in languages which mandate tail recursion elimination. Languages that don't do that are free to do the recursion, which will eventually run you out of stack. Python is in the latter category, and that's what you ran into. Thinking about iteration this way is elegant - but it doesn't work everywhere. Sorry. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list