Proposal: Adding finfo support for user-defined DTypes

Swayam Singh via NumPy-Discussion <[email protected]>
Newsgroups gmane.comp.python.numeric.general
Message-ID <[email protected]>
Hi all,

Following recent discussion, I wanted to summarize the current status of extending `np.finfo` to user-defined DTypes.

At present, there is no way for user DTypes to provide their own `finfo` information (e.g., precision, bits, eps) [issue #27231](https://github.com/numpy/numpy/issues/27231).
To address this, [PR #29763](https://github.com/numpy/numpy/pull/29763) proposes adding a new `NPY_DT_get_finfo` slot so that user-defined floating DTypes can expose this metadata.
One open question from review is whether this should remain specific to `finfo`, or if we should generalize the mechanism so that other numeric types (e.g., integers via `iinfo`) could also expose their own limits.

I’d appreciate feedback on whether we should:

* start with `finfo` support for floating user DTypes only, or
* aim for a more general interface covering both `finfo`, `iinfo`, and potentially other numeric limits.

Best,
Swayam Singh
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.