BUG: ensure passing np.dtype to itself doesn't crash#25042
Conversation
78d0619 to
ac8f1f1
Compare
|
It's a bit funny, I wonder if just flagging it as parametric would actually work :). To some degree, it is well defined (as in, it is identical to the user passing no dtype). But, overall, I am also happy with just doing this, I don't think we would have to fret over ever changing it in the future anyway. |
ac8f1f1 to
0cb5982
Compare
It turns out this makes the test I added create a
I ended up moving the check into |
|
Yeah, I think returning float64 there is actually completely fine after all that is what Making this an error for now here seems fine then. If anyone ever feals to relax it to return the float64, I would not be opposed at all, though! |
0cb5982 to
b046293
Compare
|
Thanks Nathan, let's go with this and possibly relax it if we ever find a reason for it. |
np.dtype to itself doesn't crashnp.dtype to itself doesn't crash
Happy to implement other approaches but adding a check just before the crash happens seemed simplest.
Fixes #25031.