Closed fangerer closed 1 year ago
@antocuni
sometimes it is hard to distinguish whether we are testing HPy (i.e. "HPy_DelAttr" should delete the attribute) or the underlying python implementation
Agreed. One source for this problem is that we still try to map HPy API to C API if we can. We should probably define the semantics separately for HPy but then it might happen that we can no longer directly map to a C API.
the tests have a lot a duplication
We could use a template for those kinds of tests and replace the types. I'm also fine with merging them.
@hodgestar please do another review round. I've addressed all your comments.
Agreed. One source for this problem is that we still try to map HPy API to C API if we can. We should probably define the semantics separately for HPy but then it might happen that we can no longer directly map to a C API.
I'm not sure to understand. Even if we say that HPy_DelItem
maps to PyObject_DelItem
, there is no point in testing all the possible combinations of items, is there?
This PR add a bunch of new API functions for deleting items and attributes (resolves issue #369).
Similar to CPython, functions
HPy_DelAttr(_s)
are just inline helper functions that useHPy_SetAttr(_s)
and passHPy_NULL
as value.For
HPy_DelItem(_i/_s)
, I followed the same strategy as we did forHPy_SetItem(_i/_s)
.