refactor!: allow subsets of dtypes and allow device-dependent dtype support#1005
Conversation
rgommers
left a comment
There was a problem hiding this comment.
Thanks @ev-br! One comment on a complex dtype not needing to be required, other than that this LGTM.
I considered whether to require specific types that are currently universally available (e.g., float32, int32), but that doesn't really help in any way while it does potentially create another issue if support shifts over time. So "one integer and one float dtype" seems just fine. In practice, libraries are going to just use them anyway and they will exist; actual code will rely on how to get things working with real-world libraries, not probing the must/should distinctions in the spec (that's mostly relevant for the test suite and authors of new array libraries).
Co-authored-by: Evgeni Burovski <evgeny.burovskiy@gmail.com>
|
Looks like we have consensus. I will go ahead and merge and we can still tinker with guidance in the lead up to cutting the v2026 revision later this year. |
Per discussion in gh-998 and the community meeting on Apr 30th,
dtype=..., device=...raise an exception + specify that creation functions should raise. Note that this still leavesastypeandto_deviceonly implicitly specified and only covered by the recommendation to raise.__getitem__and__setitem__are implementation-defined (and presumably covered by the recommendation to raise).