Serhiy Storchaka added the comment:

_Py_MakeEndRecCheck() was changed in issue5392 (noised Antoine as a committer). 
There are many ways to make it monotonic.

#define _Py_MakeEndRecCheck(x) \
        (--(x) < ((_Py_CheckRecursionLimit > 200) \
                ? (_Py_CheckRecursionLimit - 25) \
                : (3 * (_Py_CheckRecursionLimit >> 2))))

#define _Py_MakeEndRecCheck(x) \
        (--(x) < ((_Py_CheckRecursionLimit > 100) \
                ? (_Py_CheckRecursionLimit - 50) \
                : (_Py_CheckRecursionLimit >> 1)))

Since the formula is so complex, it would be worth to extract common part from 
_Py_MakeEndRecCheck() and sys_setrecursionlimit(). Otherwise the code can 
become desynchronized.

The error message still looks confusing to me. May be short it to "limit is too 
low"? Noised David as grammar expert.

Why not have an hardcoded minimum limit? Current recursion depth and therefore 
minimal recursion limit are implementation defined and can depend on a way how 
the module is executed (run a script, import a module, run with runpy or IDLE, 
etc). May be interpret the limit relatively to current recursion depth?

----------
nosy: +pitrou, r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25274>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to