Skip to content

Commit 78ba7c6

Browse files
bpo-42294: Grammar fixes in doc glossary strong/weak refs (GH-23227)
1 parent 7e5ef0a commit 78ba7c6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Doc/c-api/weakref.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ as much as it can.
5959
6060
This function returns a :term:`borrowed reference` to the referenced object.
6161
This means that you should always call :c:func:`Py_INCREF` on the object
62-
except it cannot be destroyed before the last usage of the borrowed
62+
except when it cannot be destroyed before the last usage of the borrowed
6363
reference.
6464
6565

Doc/glossary.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ Glossary
159159
:class:`str` objects.
160160

161161
borrowed reference
162-
In the Python's C API, a borrowed reference is a reference to an object.
162+
In Python's C API, a borrowed reference is a reference to an object.
163163
It does not modify the object reference count. It becomes a dangling
164164
pointer if the object is destroyed. For example, a garbage collection can
165165
remove the last :term:`strong reference` to the object and so destroy it.
166166

167167
Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is
168168
recommended to convert it to a :term:`strong reference` in-place, except
169-
if the object cannot be destroyed before the last usage of the borrowed
169+
when the object cannot be destroyed before the last usage of the borrowed
170170
reference. The :c:func:`Py_NewRef` function can be used to create a new
171171
:term:`strong reference`.
172172

@@ -1113,9 +1113,9 @@ Glossary
11131113
as :keyword:`if`, :keyword:`while` or :keyword:`for`.
11141114

11151115
strong reference
1116-
In the Python's C API, a strong reference is a reference to an object
1117-
which increments object reference count when it is created and
1118-
decrements the object reference count when it is deleted.
1116+
In Python's C API, a strong reference is a reference to an object
1117+
which increments the object's reference count when it is created and
1118+
decrements the object's reference count when it is deleted.
11191119

11201120
The :c:func:`Py_NewRef` function can be used to create a strong reference
11211121
to an object. Usually, the :c:func:`Py_DECREF` function must be called on

0 commit comments

Comments
 (0)