delay and force in Python

Bengt Richter bokr at
Thu Jan 20 08:53:25 CET 2005

On Wed, 19 Jan 2005 23:53:28 +1000, Nick Coghlan <ncoghlan at> wrote:
>> Something else: this crashes with a "maximum recursion reached"
>> . print stream_enumerate_interval(1,998)
>> while this does not crash
>> . print stream_enumerate_interval(1,900)
>> this means Python has a maximum of something like 900
>> recursions?
>The CPython implementation is limited by the stack size allocated by the C 
>runtime library. The exact recursion limit is platform dependent, but something 
>around 1000 sounds fairly normal.
ISTM you forgot something ;-)
(I.e., that 1000 is only a default value (don't know if same on all platforms)).

 >>> import sys
 >>> help(sys.setrecursionlimit)
 Help on built-in function setrecursionlimit in module sys:


     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 highest possible limit is platform-

Bengt Richter

More information about the Python-list mailing list