Skip to content

Commit 6d4c2c4

Browse files
authored
Merge pull request numpy#26097 from mtsokol/fix-copy-arg-array
DOC: Mention `copy=True` for `__array__` method in the migration guide.
2 parents 4517378 + 86b94dc commit 6d4c2c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/source/numpy_2_0_migration_guide.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,9 @@ The :ref:`copy keyword behavior changes <copy-keyword-changes-2.0>` in
422422
of how to do so.
423423
3. For any ``__array__`` method on a non-NumPy array-like object, a
424424
``copy=None`` keyword can be added to the signature - this will work with
425-
older NumPy versions as well.
425+
older NumPy versions as well. If ``copy`` keyword is considered in
426+
the ``__array__`` method implementation, then for ``copy=True`` always
427+
return a new copy.
426428

427429

428430
Writing numpy-version-dependent code

0 commit comments

Comments
 (0)