summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-07-17 08:32:53 (GMT)
committerGitHub <noreply@github.com>2019-07-17 08:32:53 (GMT)
commit35d36dacd410af96d794277c5ae6986d95d50e5a (patch)
tree56a3f55418903d61e94dfe919ff6e4d6212cd5b8
parent178f09f8b7d25348d46751a774666dd4ec32f3e6 (diff)
downloadcpython-35d36dacd410af96d794277c5ae6986d95d50e5a.zip
cpython-35d36dacd410af96d794277c5ae6986d95d50e5a.tar.gz
cpython-35d36dacd410af96d794277c5ae6986d95d50e5a.tar.bz2
Docs: Correct formatting of a multiline code block (GH-13806)
(cherry picked from commit bd26a4466b507e196fc9a5e4a6cb7cd6d39f85aa) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
-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 72d9650..7553efc 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