summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>2019-07-17 03:13:01 -0500
committerTal Einat <taleinat@gmail.com>2019-07-17 11:13:01 +0300
commitbd26a4466b507e196fc9a5e4a6cb7cd6d39f85aa (patch)
tree342c855416e48b4832fa9d3b706cc723ce12a5fa
parentf8d4cc7dbbf54b9c5435c3080582a4aa421a067d (diff)
downloadcpython-git-bd26a4466b507e196fc9a5e4a6cb7cd6d39f85aa.tar.gz
Docs: Correct formatting of a multiline code block (GH-13806)
-rw-r--r--Doc/c-api/buffer.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 72d965053c..7553efc2cf 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