Closed
Description
I found while writing a ufunc that takes structured dtypes for its inputs that casting of essentially everything is allowed to a structured dtype, which is surprising. This is reflected in can_cast
:
np.can_cast('f8', 'u1')
# False
np.can_cast('f8', '2u1')
# True
I would have expected, at least for safe
, that casting would only be allowed if the dtypes were the same (or, perhaps, that can_cast
was applied recursively).