Armin Rigo  committed 2d2a163

Doc update: sys.setrecursionlimit

  • Participants
  • Parent commits 170dab0
  • Branches default

Comments (0)

Files changed (1)

File pypy/doc/cpython_differences.rst , some of us believe it has no
   purpose in CPython either.
-* ``sys.setrecursionlimit()`` is ignored (and not needed) on
-  PyPy.  On CPython it would set the maximum number of nested
-  calls that can occur before a RuntimeError is raised; on PyPy
-  overflowing the stack also causes RuntimeErrors, but the limit
-  is checked at a lower level.  (The limit is currently hard-coded
-  at 768 KB, corresponding to roughly 1480 Python calls on
-  Linux.)
+* ``sys.setrecursionlimit(n)`` sets the limit only approximately,
+  by setting the usable stack space to ``n * 768`` bytes.  On Linux,
+  depending on the compiler settings, the default of 768KB is enough
+  for about 1400 calls.
 * assignment to ``__class__`` is limited to the cases where it
   works on CPython 2.5.  On CPython 2.6 and 2.7 it works in a bit