You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> A = np.array([2**63, 2**63+1], dtype=np.uint64)
>>> sum_up(A)
1.8446744073709552e+19
It seems like A is being converted to a f64, and then addition is carried out. (For reference, A.sum() = 1.) I thought that the TypeMustMatch means that the array's dtype must be f64.
Either I'm misunderstanding TypeMustMatch or perhaps there is a bug here?
I think this is related to some functionality I touched on in #491, where there is an attempt to extract PyArrayLike1<T> from Vec<T>.
I'd agree that this is probably not the desired behavior, since AllowTypeChange/TypeMustMatch is only applied to 1D arrays if extraction from a Vec fails.
Activity
jakemoran commentedon Jun 3, 2025
I think this is related to some functionality I touched on in #491, where there is an attempt to extract
PyArrayLike1<T>fromVec<T>.I'd agree that this is probably not the desired behavior, since
AllowTypeChange/TypeMustMatchis only applied to 1D arrays if extraction from aVecfails.rust-numpy/src/array_like.rs
Lines 152 to 161 in 8bfbb27
Icxolu commentedon Dec 13, 2025
Fixed by #520