summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-02-01 18:40:50 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-02-01 18:40:50 (GMT)
commit3f1ef5b756e96486ca4155eb96485e405720d107 (patch)
treebd7991964dd2e0d37a957b1fb9ad235e4707dbf7
parent0a7fc53be297b718af0c02de3abbd1f94f78f9c1 (diff)
downloadcpython-3f1ef5b756e96486ca4155eb96485e405720d107.zip
cpython-3f1ef5b756e96486ca4155eb96485e405720d107.tar.gz
cpython-3f1ef5b756e96486ca4155eb96485e405720d107.tar.bz2
Issue #23352: Document that Py_buffer.suboffsets must be NULL if no suboffsets
are required.
-rw-r--r--Doc/c-api/buffer.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 74693ac..7df9c33 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -98,8 +98,11 @@ The new-style Py_buffer struct
suboffset value that it negative indicates that no de-referencing should
occur (striding in a contiguous memory block).
+ If all suboffsets are negative (i.e. no de-referencing is needed, then
+ this field must be NULL (the default value).
+
Here is a function that returns a pointer to the element in an N-D array
- pointed to by an N-dimesional index when there are both non-NULL strides
+ pointed to by an N-dimensional index when there are both non-NULL strides
and suboffsets::
void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,