Should we have HPyDict_GetItem #404
Labels
API design
HPy update in GraalPy
This change requires a related change in GraalPy
HPy update in PyPy
This change requires a related change in PyPy
In February 2023's dev call, we had some discussion about if we should have
HPyDict_GetItem
(similar toPyDict_GetItem
).PyDict_GetItem
has following semantic differences compared to the genericPyObject_GetItem
:__hash__
and__eq__
methods.dict
(usesPyDict_Check
internally), then it the function will directly access the dict. This means, any overwritten__getitem__
will be ignored.Arguments for having
HPyDict_GetItem
:HPyDict_GetItem
in HPy:PyDict_GetItem
is used a lot. On my checkout of the top4000 packages, it is used 658 times (this includesPyDict_GetItemString
).NULL
without clearing errors.Arguments against:
@hodgestar made two suggestions:
HPyBuiltin_GetItem
(i.e. don't do an attribute lookup but access storage directly if it is an appropriate built-in type).HPy_GetItem_NoError
to make the behavior clear.The text was updated successfully, but these errors were encountered: