I currently try to get rid of HPy_SetType in branch graal-team/hpy . We used it (as a replacement for Py_SET_TYPE) in function dtypemeta_wrap_legacy_descriptor. I was able to refactor the creation of (_hpy)_builtin_descrs (see https://github.com/hpyproject/numpy-hpy/blob/graal-team/hpy/numpy/core/src/multiarray/arraytypes.c.src#L4842). I did so by first creating the new dtype and then instantiating the singleton. However, it is not that simple for Numpy API (H)PyArray_RegisterDataType because the descriptor to register is provided as argument (e.g. sometimes created with (H)PyArray_DescrNew).
My question is: are (H)PyArray_DescrNew and (H)PyArray_RegisterDataType legacy APIs that have some replacement and could we just drop them in Numpy/HPy?
Or is there some other way to solve this?
I currently try to get rid of
HPy_SetTypein branch graal-team/hpy . We used it (as a replacement forPy_SET_TYPE) in functiondtypemeta_wrap_legacy_descriptor. I was able to refactor the creation of(_hpy)_builtin_descrs(see https://github.com/hpyproject/numpy-hpy/blob/graal-team/hpy/numpy/core/src/multiarray/arraytypes.c.src#L4842). I did so by first creating the new dtype and then instantiating the singleton. However, it is not that simple for Numpy API(H)PyArray_RegisterDataTypebecause the descriptor to register is provided as argument (e.g. sometimes created with(H)PyArray_DescrNew).My question is: are
(H)PyArray_DescrNewand(H)PyArray_RegisterDataTypelegacy APIs that have some replacement and could we just drop them in Numpy/HPy?Or is there some other way to solve this?