Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disallow truncation in types.arraydata
If `types.arraydata` is passed a `numpy.array` with dtype `numpy.int64` and the platform default int type is 32 bit, then `types.arraydata` truncates the array to `numpy.int32` without warning. This behavior is inherited from `numpy.astype`. Since this may lead to unexpected behavior, this patch disallows truncation by passing `casting='safe'` to `numpy.astype`. Deliberate truncation should now be done before passing the array to `types.arraydata`.
- Loading branch information