From 29f298a8b7623540cf911391a8194f0c7a41a2e2 Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Thu, 23 Nov 2017 12:50:40 +0100 Subject: [PATCH 1/2] Move footnote marker closer to the related term, before sentence's ending dot --- Doc/extending/extending.rst | 8 ++++---- Doc/extending/newtypes.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 7c273533aba5b5..0e858294c4f5ab 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -40,7 +40,7 @@ A Simple Example Let's create an extension module called ``spam`` (the favorite food of Monty Python fans...) and let's say we want to create a Python interface to the C -library function :c:func:`system`. [#]_ This function takes a null-terminated +library function :c:func:`system`\ [#]_. This function takes a null-terminated character string as argument and returns an integer. We want this function to be callable from Python as follows:: @@ -913,11 +913,11 @@ needed. Ownership of a reference can be transferred. There are three ways to dispose of an owned reference: pass it on, store it, or call :c:func:`Py_DECREF`. Forgetting to dispose of an owned reference creates a memory leak. -It is also possible to :dfn:`borrow` [#]_ a reference to an object. The +It is also possible to :dfn:`borrow`\ [#]_ a reference to an object. The borrower of a reference should not call :c:func:`Py_DECREF`. The borrower must not hold on to the object longer than the owner from which it was borrowed. Using a borrowed reference after the owner has disposed of it risks using freed -memory and should be avoided completely. [#]_ +memory and should be avoided completely [#]_. The advantage of borrowing over owning a reference is that you don't need to take care of disposing of the reference on all possible paths through the code @@ -1088,7 +1088,7 @@ checking. The C function calling mechanism guarantees that the argument list passed to C functions (``args`` in the examples) is never *NULL* --- in fact it guarantees -that it is always a tuple. [#]_ +that it is always a tuple [#]_. It is a severe error to ever let a *NULL* pointer "escape" to the Python user. diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst index 0e36ba0aec07ae..62fbdb87a53000 100644 --- a/Doc/extending/newtypes.rst +++ b/Doc/extending/newtypes.rst @@ -659,7 +659,7 @@ Fortunately, Python's cyclic-garbage collector will eventually figure out that the list is garbage and free it. In the second version of the :class:`Noddy` example, we allowed any kind of -object to be stored in the :attr:`first` or :attr:`last` attributes. [#]_ This +object to be stored in the :attr:`first` or :attr:`last` attributes [#]_. This means that :class:`Noddy` objects can participate in cycles:: >>> import noddy2 From b612f6406a83ad75a0908da043560274912440a1 Mon Sep 17 00:00:00 2001 From: Mariatta Date: Fri, 24 Nov 2017 00:42:36 -0800 Subject: [PATCH 2/2] Remove unneeded backslash. --- Doc/extending/extending.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 0e858294c4f5ab..ea1c29a397ed86 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -40,7 +40,7 @@ A Simple Example Let's create an extension module called ``spam`` (the favorite food of Monty Python fans...) and let's say we want to create a Python interface to the C -library function :c:func:`system`\ [#]_. This function takes a null-terminated +library function :c:func:`system` [#]_. This function takes a null-terminated character string as argument and returns an integer. We want this function to be callable from Python as follows:: @@ -913,7 +913,7 @@ needed. Ownership of a reference can be transferred. There are three ways to dispose of an owned reference: pass it on, store it, or call :c:func:`Py_DECREF`. Forgetting to dispose of an owned reference creates a memory leak. -It is also possible to :dfn:`borrow`\ [#]_ a reference to an object. The +It is also possible to :dfn:`borrow` [#]_ a reference to an object. The borrower of a reference should not call :c:func:`Py_DECREF`. The borrower must not hold on to the object longer than the owner from which it was borrowed. Using a borrowed reference after the owner has disposed of it risks using freed