hpyproject / hpy

HPy: a better API for Python
https://hpyproject.org
MIT License
1.02k stars 52 forks source link

HPyErr_Format missing #463

Closed mattip closed 6 months ago

mattip commented 6 months ago

It would be nice to have HPyErr_Format with a signature like PyErr_Format

PyErr_Format(PyObject *exception, const char *format, ...);
fangerer commented 6 months ago

It is there: https://github.com/hpyproject/hpy/blob/a5c70cd1c19304bb2a164ab3dd69ab46b1ed542a/hpy/devel/include/hpy/runtime/format.h#L16

See also docs.

mattip commented 6 months ago

Ahh, thanks, missed that. Then it should be used in the NumPy port here, I will add it to my PR.

fangerer commented 6 months ago

Yes, there may be many locations where it should be used. We introduced it after we started migrating NumPy. I personally always added a TODO and kept the full C API call in a comment and I thought I later fixed all those. Others may not have marked those locations. So, whenever you find one, feel free to migrate and open a PR.