pitrou commented on code in PR #40708:
URL: https://github.com/apache/arrow/pull/40708#discussion_r1534109979


##########
docs/source/format/CDataInterface/PyCapsuleInterface.rst:
##########
@@ -142,6 +154,22 @@ Arrays and record batches (contiguous tables) can 
implement the method
         respectively. The schema capsule should have the name 
``"arrow_schema"``
         and the array capsule should have the name ``"arrow_array"``.
 
+Libraries supporting the Device interface can implement a 
``__arrow_c_device_array__``
+method on those objects, which works the same as ``__arrow_c_array__`` except
+for returning a ArrowDeviceArray structure instead of a ArrowArray structure:
+
+.. py:method:: __arrow_c_device_array__(self, requested_schema: object | None 
= None) -> Tuple[object, object]

Review Comment:
   I see we already did it above, but it's not useful to add machine-oriented 
type annotations to a human-readable doc. The parameter types are described 
explicitly below.
   
   The HTML rendering is not terrible but it's not great either, as the 
signature looks crowded: 
https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#arrowarray-export



-- 
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