[Python-checkins] [3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002)

hugovk webhook-mailer at python.org
Sat Mar 25 03:44:12 EDT 2023


https://github.com/python/cpython/commit/7513c6b6fe50dd651abe4d9b0c2f207b032cabfe
commit: 7513c6b6fe50dd651abe4d9b0c2f207b032cabfe
branch: 3.10
author: Hugo van Kemenade <hugovk at users.noreply.github.com>
committer: hugovk <hugovk at users.noreply.github.com>
date: 2023-03-25T09:44:05+02:00
summary:

[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002)

files:
M Doc/c-api/weakref.rst
M Doc/library/gzip.rst

diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst
index cb6aba33b568..b471260e1769 100644
--- a/Doc/c-api/weakref.rst
+++ b/Doc/c-api/weakref.rst
@@ -68,3 +68,13 @@ as much as it can.
 
    Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that does no
    error checking.
+
+
+.. c:function:: void PyObject_ClearWeakRefs(PyObject *object)
+
+   This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler
+   to clear weak references.
+
+   This iterates through the weak references for *object* and calls callbacks
+   for those references which have one. It returns when all callbacks have
+   been attempted.
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 33c40676f747..ec92fa2611bc 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -143,6 +143,12 @@ The module defines the following items:
       :func:`time.time` and the :attr:`~os.stat_result.st_mtime` attribute of
       the object returned by :func:`os.stat`.
 
+   .. attribute:: name
+
+      The path to the gzip file on disk, as a :class:`str` or :class:`bytes`.
+      Equivalent to the output of :func:`os.fspath` on the original input path,
+      with no other normalization, resolution or expansion.
+
    .. versionchanged:: 3.1
       Support for the :keyword:`with` statement was added, along with the
       *mtime* constructor argument and :attr:`mtime` attribute.



More information about the Python-checkins mailing list