From 7ca3735d319e5193fab3241e55625879db6e03aa Mon Sep 17 00:00:00 2001 From: Joseph Fox-Rabinovitz Date: Tue, 4 Jun 2019 08:22:12 -0500 Subject: [PATCH] Corrected formatting of multiline code block Incorrect formatting can be seen here: https://docs.python.org/3/c-api/buffer.html#numpy-style-shape-and-strides --- Doc/c-api/buffer.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index 72d965053cfda3..7553efc2cfbc1e 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -355,8 +355,10 @@ If :c:member:`~Py_buffer.strides` is *NULL*, the array is interpreted as a standard n-dimensional C-array. Otherwise, the consumer must access an n-dimensional array as follows: - ``ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1]`` - ``item = *((typeof(item) *)ptr);`` +.. code-block:: c + + ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1]; + item = *((typeof(item) *)ptr); As noted above, :c:member:`~Py_buffer.buf` can point to any location within