On Fri, Jul 17, 2015 at 2:50 AM, Joonas Liik <liik.joo...@gmail.com> wrote: > Wouldn't it be possible to have like a dynamically > sized stack so that you can grow it endlessly > with some acceptable overhead.. > > That would pretty much take care of the stack-overflow > argument without many painful side effects on > the semantics at least..
The trouble with that is that it can quickly run you out memory when you accidentally trigger infinite recursion. A classic example is a simple wrapper function... def print(msg): print(ctime()+" "+msg) With the recursion limit at its default of 1000, this can't do more than 1000 iterations before the system detects that it's stuck. With an infinite stack, this could destroy your system memory and then finally terminate with MemoryError... if you're lucky. If you're not, the whole system could get wedged before this gets killed. (Imagine, for instance, a computer with a large hard disk devoted to virtual memory. Long before that's exhausted, the system will be practically unusable, because every little operation will require going back to the disk.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list