[Python-checkins] CVS: python/dist/src/Doc/lib libsys.tex,1.39,1.40

Jeremy Hylton python-dev@python.org
Thu, 31 Aug 2000 12:23:04 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv961/Doc/lib

Modified Files:
	libsys.tex 
Log Message:
add user-modifiable recursion_limit

ceval.c:
    define recurion_limit (static), default value is 2500
    define Py_GetRecursionLimit and Py_SetRecursionLimit
    raise RuntimeError if limit is exceeded
PC/config.h:
    remove plat-specific definition
sysmodule.c:
    add sys.(get|set)recursionlimit


Index: libsys.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsys.tex,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** libsys.tex	2000/08/15 04:24:43	1.39
--- libsys.tex	2000/08/31 19:22:59	1.40
***************
*** 149,152 ****
--- 149,159 ----
  \end{funcdesc}
  
+ \begin{funcdesc}{getrecursionlimit}{}
+ Return the current value of the recursion limit, the maximum depth of
+ the Python interpreter stack.  This limit prevents infinite recursion
+ from causing an overflow of the C stack and crashing Python.  It can
+ be set by \function{setrecursionlimit}.
+ \end{funcdesc}
+ 
  \begin{datadesc}{hexversion}
  The version number encoded as a single integer.  This is guaranteed to
***************
*** 275,278 ****
--- 282,296 ----
  \index{profile function}
  \index{profiler}
+ 
+ \begin{funcdesc}{setrecursionlimit}{limit}
+ Set the maximum depth of the Python interpreter stack to \var{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.
+ \edn{funcdesc}
  
  \begin{funcdesc}{settrace}{tracefunc}