jorisvandenbossche commented on code in PR #41071:
URL: https://github.com/apache/arrow/pull/41071#discussion_r1557646253


##########
python/pyarrow/array.pxi:
##########
@@ -1543,7 +1543,20 @@ cdef class Array(_PandasConvertible):
     def _to_pandas(self, options, types_mapper=None, **kwargs):
         return _array_like_to_pandas(self, options, types_mapper=types_mapper)
 
-    def __array__(self, dtype=None):
+    def __array__(self, dtype=None, copy=None):
+        # TODO honor the copy=True case

Review Comment:
   > Can we raise an exception for now?
   
   I wouldn't do that I think, because then when numpy would start passing that 
down in let's say numpy 2.1, `np.array(obj)` would start erroring, while those 
never errored before (and for some cases this might incorrectly not return a 
copy (although still marked as read-only), many cases already do copy anyways)
   
   Although to be honest, I don't really know what the strategy of numpy will 
be to enable this keyword. If they would just start to stop copying the result 
of `__array__`, that would cause such changes in many libraries with 
`__array__`s)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to