Document that struct binding getters return a copy of a value and propagating any changes must go through the setter #262
Labels
cuda.bindings
Everything related to the cuda.bindings module
documentation
Improvements or additions to documentation
P1
Medium priority - Should do
Milestone
As uncovered here, there's a lack of clarity in how attributes get packaged for Cython's Extension Types. While the bindings outwardly presents their attributes in a Pythonic way, they can't always be interacted with in a Pythonic style. Often the getters/setters is actually a translation step to convert values between Python and C.
In this specific example, the setter makes sure that the Python list elements are packages in a contiguous memory for C consumption. The getter returns a copy of each element in a Python list. Both behaviors are unnatural for Python users and we should document that there's an emphasis to use the getter/setter directly.
The text was updated successfully, but these errors were encountered: