diff options
author | kj <28750310+Fidget-Spinner@users.noreply.github.com> | 2020-11-10 23:56:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 23:56:55 (GMT) |
commit | 78ba7c69ada2f7eefd4e3ea375337d78dc2ce721 (patch) | |
tree | 88d49a0a8ee549d019116c322d566fa917919bc2 /Doc | |
parent | 7e5ef0a5713f968f6e942566c78bf57ffbef01de (diff) | |
download | cpython-78ba7c69ada2f7eefd4e3ea375337d78dc2ce721.zip cpython-78ba7c69ada2f7eefd4e3ea375337d78dc2ce721.tar.gz cpython-78ba7c69ada2f7eefd4e3ea375337d78dc2ce721.tar.bz2 |
bpo-42294: Grammar fixes in doc glossary strong/weak refs (GH-23227)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/weakref.rst | 2 | ||||
-rw-r--r-- | Doc/glossary.rst | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst index fb6628a..9205ca6 100644 --- a/Doc/c-api/weakref.rst +++ b/Doc/c-api/weakref.rst @@ -59,7 +59,7 @@ as much as it can. This function returns a :term:`borrowed reference` to the referenced object. This means that you should always call :c:func:`Py_INCREF` on the object - except it cannot be destroyed before the last usage of the borrowed + except when it cannot be destroyed before the last usage of the borrowed reference. diff --git a/Doc/glossary.rst b/Doc/glossary.rst index b410585..0661c82 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -159,14 +159,14 @@ Glossary :class:`str` objects. borrowed reference - In the Python's C API, a borrowed reference is a reference to an object. + In Python's C API, a borrowed reference is a reference to an object. It does not modify the object reference count. It becomes a dangling pointer if the object is destroyed. For example, a garbage collection can remove the last :term:`strong reference` to the object and so destroy it. Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended to convert it to a :term:`strong reference` in-place, except - if the object cannot be destroyed before the last usage of the borrowed + when the object cannot be destroyed before the last usage of the borrowed reference. The :c:func:`Py_NewRef` function can be used to create a new :term:`strong reference`. @@ -1113,9 +1113,9 @@ Glossary as :keyword:`if`, :keyword:`while` or :keyword:`for`. strong reference - In the Python's C API, a strong reference is a reference to an object - which increments object reference count when it is created and - decrements the object reference count when it is deleted. + In Python's C API, a strong reference is a reference to an object + which increments the object's reference count when it is created and + decrements the object's reference count when it is deleted. The :c:func:`Py_NewRef` function can be used to create a strong reference to an object. Usually, the :c:func:`Py_DECREF` function must be called on |