bpo-29548: Recommend PyObject_Call APIs over PyEval_Call APIs. by methane · Pull Request #75 · python/cpython
methane
changed the title
bpo-29548: deprecate PyEval_Call APIs.
bpo-29548: Stop using PyEval_Call* APIs.
methane
changed the title
bpo-29548: Stop using PyEval_Call* APIs.
bpo-29548: Recomend PyObject_Call APIs over PyEval_Call* APIs.
ncoghlan
changed the title
bpo-29548: Recomend PyObject_Call APIs over PyEval_Call* APIs.
bpo-29548: Recommend PyObject_Call APIs over PyEval_Call* APIs.
methane
changed the title
bpo-29548: Recommend PyObject_Call APIs over PyEval_Call* APIs.
bpo-29548: Recommend PyObject_Call APIs over PyEval_Call APIs.
PyEval_Call* APIs are not documented and they doesn't respect PY_SSIZE_T_CLEAN. So add comment block to recommend PyObject_Call* APIs where they are declared. This commit also changes PyEval_CallMethod and PyEval_CallFunction implementation same to PyObject_CallMethod and PyObject_CallFunction to reduce future maintenance cost. Optimization to avoid temporary tuple are copied too. PyEval_CallFunction(callable, "i", (int)i) now calls callable(i) instead of raising TypeError. But accepting this edge case is backward compatible.
methane
deleted the
deprecate-evalcall
branch
oraluben pushed a commit to oraluben/cpython that referenced this pull request
Jul 15, 2023lysnikolaou referenced this pull request in lysnikolaou/cpython
May 1, 2024This was referenced
Feb 11, 2025This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters