diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2023-05-13 11:02:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 11:02:49 -0600 |
commit | 5187067d7ad176ee3614beab2b99a524dd719aa8 (patch) | |
tree | 907997d0c294f550193322aaa73237c1a7bcfaa6 /doc/release/upcoming_changes/21995.compatibility.rst | |
parent | b786189222ac5bf2f4efbb04399261f7f760bc18 (diff) | |
parent | 81caed6e3c34c4bf4b22b4f6167e816ba2a3f73c (diff) | |
download | numpy-5187067d7ad176ee3614beab2b99a524dd719aa8.tar.gz |
Merge branch 'main' into deprecate-find-common-type
Diffstat (limited to 'doc/release/upcoming_changes/21995.compatibility.rst')
-rw-r--r-- | doc/release/upcoming_changes/21995.compatibility.rst | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/doc/release/upcoming_changes/21995.compatibility.rst b/doc/release/upcoming_changes/21995.compatibility.rst deleted file mode 100644 index 0ae5e3626..000000000 --- a/doc/release/upcoming_changes/21995.compatibility.rst +++ /dev/null @@ -1,21 +0,0 @@ -Returned arrays respect uniqueness of dtype kwarg objects ---------------------------------------------------------- -When the ``dtype`` keyword argument is used with :py:func:`np.array()` -or :py:func:`asarray()`, the dtype of the returned array now -always exactly matches the dtype provided by the caller. - -In some cases this change means that a *view* rather than the -input array is returned. -The following is an example for this on 64bit Linux where ``long`` -and ``longlong`` are the same precision but different ``dtypes``:: - - >>> arr = np.array([1, 2, 3], dtype="long") - >>> new_dtype = np.dtype("longlong") - >>> new = np.asarray(arr, dtype=new_dtype) - >>> new.dtype is new_dtype - True - >>> new is arr - False - -Before the change, the ``dtype`` did not match because ``new is arr`` -was ``True``. |