Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78ba7c6

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

File tree

2 files changed

+6
-6
lines changed
Filter options

2 files changed

+6
-6
lines changed

‎Doc/c-api/weakref.rst

Copy file name to clipboardExpand all lines: Doc/c-api/weakref.rst
+1-1Lines 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

Copy file name to clipboardExpand all lines: Doc/glossary.rst
+5-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.