| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@iritkatriel: Are you ok with this rename? |
Sorry, something went wrong.
| layout, optimization, and WASI runtime. Wasmtime can handle about 700 | ||
| recursions, sometimes less. 500 is a more conservative limit. */ | ||
| #ifndef C_RECURSION_LIMIT | ||
| #ifndef Py_C_RECURSION_LIMIT |
There was a problem hiding this comment.
Do users define this?
Sorry, something went wrong.
There was a problem hiding this comment.
I don't know if it's relevant to support that. It's supposed to be a constant built into Python, no?
Sorry, something went wrong.
|
@iritkatriel: I removed #ifndef Py_C_RECURSION_LIMIT. Would you mind to review again the PR? |
Sorry, something went wrong.
It's too late to backport to Python 3.12. |
Sorry, something went wrong.
|
I don't think that it makes sense to override the Py_C_RECURSION_LIMIT constant. Python does hardcode this constant in its code. For example, init_threadstate() sets tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT;. Building Python with a different Py_C_RECURSION_LIMIT value sounds like a borderline usecase. If someone cares about fine tuning Py_C_RECURSION_LIMIT, I would suggest adding a ./configure option. Currently, building Python with a different C_RECURSION_LIMIT value leads to inconsistencies for C extensions built with the default Py_C_RECURSION_LIMIT value (1500). Including <Python.h> and overriding Py_C_RECURSION_LIMIT sounds like a bad idea: Python will anyway uses its hardcoded constants (ex: in init_threadstate()), changing the constant doesn't change Python behavior. It only leads to inconsistency. In short, IMO it's a good thing to remove #ifndef C_RECURSION_LIMIT :-) |
Sorry, something went wrong.
Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on #include <Python.h>.
test.pythoninfo logs Py_C_RECURSION_LIMIT and other _testcapi and _testinternalcapi constants.
|
Since Py_C_RECURSION_LIMIT value is different on WASI, I modified test.pythoninfo to log the value, to ease debugging test failures related to recursion. Recently, I added sys.getrecursionlimit to test.pythoninfo when I fixed test_tomllib recursion error (commit 8ff1142). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on #include <Python.h>.