[issue37645] Replace PyEval_GetFuncName/PyEval_GetFuncDesc

Jeroen Demeyer report at bugs.python.org
Sun Jul 21 13:46:15 EDT 2019


New submission from Jeroen Demeyer <J.Demeyer at UGent.be>:

PyEval_GetFuncName is bad API because

1. It hardcodes a limited number of function classes (which doesn't even include all function classes in the core interpreter) instead of supporting duck-typing.
2. In case of a "function" object, it relies on a borrowed reference to the function.
3. It is returning a C string instead of a Python string, so we cannot return a new reference even if we wanted to.

Since PyEval_GetFuncName and PyEval_GetFuncDesc are always used together, we might as well replace them by a single function with a proper API.

----------
components: Interpreter Core
messages: 348255
nosy: jdemeyer, vstinner
priority: normal
severity: normal
status: open
title: Replace PyEval_GetFuncName/PyEval_GetFuncDesc
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37645>
_______________________________________


More information about the Python-bugs-list mailing list