@@ -244,7 +244,6 @@ The following fields are not influenced by *flags* and must always be filled in
244
244
with the correct values: :c:member: `~Py_buffer.obj `, :c:member: `~Py_buffer.buf `,
245
245
:c:member: `~Py_buffer.len `, :c:member: `~Py_buffer.itemsize `, :c:member: `~Py_buffer.ndim `.
246
246
247
-
248
247
readonly, format
249
248
~~~~~~~~~~~~~~~~
250
249
@@ -253,7 +252,8 @@ readonly, format
253
252
Controls the :c:member: `~Py_buffer.readonly ` field. If set, the exporter
254
253
MUST provide a writable buffer or else report failure. Otherwise, the
255
254
exporter MAY provide either a read-only or writable buffer, but the choice
256
- MUST be consistent for all consumers.
255
+ MUST be consistent for all consumers. For example, :c:expr: `PyBUF_SIMPLE | PyBUF_WRITABLE `
256
+ can be used to request a simple writable buffer.
257
257
258
258
.. c :macro :: PyBUF_FORMAT
259
259
@@ -265,8 +265,9 @@ readonly, format
265
265
Since :c:macro: `PyBUF_SIMPLE ` is defined as 0, :c:macro: `PyBUF_WRITABLE `
266
266
can be used as a stand-alone flag to request a simple writable buffer.
267
267
268
- :c:macro: `PyBUF_FORMAT ` can be \| 'd to any of the flags except :c:macro: `PyBUF_SIMPLE `.
269
- The latter already implies format ``B `` (unsigned bytes).
268
+ :c:macro: `PyBUF_FORMAT ` must be \| 'd to any of the flags except :c:macro: `PyBUF_SIMPLE `, because
269
+ the latter already implies format ``B `` (unsigned bytes). :c:macro: `!PyBUF_FORMAT ` cannot be
270
+ used on its own.
270
271
271
272
272
273
shape, strides, suboffsets
0 commit comments