hpy
hpy copied to clipboard
Functions should not suppress unrelated exceptions
I think that issue https://github.com/capi-workgroup/problems/issues/51 raises (pun intended) good points about APIs such as:
- PyDict_GetItem and PyDict_GetItemString
- PyMapping_HasKey and PyMapping_HasKeyString
- PyObject_HasAttr and PyObject_HasAttrString
- PySys_GetObject
For the time being HPy only exposes PyObject_HasAttr
and I think we should change its semantics to match the PyObject_HasAttrEx
suggested in the issue. For older CPython versions using a hand-written implementation and for newer delegating to PyObject_HasAttrEx
if it makes it upstream.