Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
Feature or enhancement
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
Proposal:
FunctionsPyDict_GetItem()
,PyDict_GetItemString()
,PyMapping_HasKey()
,PyMapping_HasKeyString()
,PyObject_HasAttr()
,PyObject_HasAttrString()
andPySys_GetObject()
have a flaw -- they clear any error raised inside the function, including important and critical errors. They cannot be fixed, because the user code which use them do not handle errors. There are replacements free from this flaw forPyDict_GetItem()
(PyDict_GetItemWithError()
andPyDict_GetItemRef()
) and, in some applications, toPyDict_GetItemString()
(PyDict_GetItemRefString()
).
We need new functions similar toPyMapping_HasKey()
,PyMapping_HasKeyString()
,PyObject_HasAttr()
,PyObject_HasAttrString()
which return three-state value (1
- yes,0
-- no, and-1
--error). What should be their names? Add theWithError
suffix? Add theEx
sufix? Add the2
suffix?