]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Sat, 25 Mar 2023 07:44:05 +0000 (09:44 +0200)
committerGitHub <noreply@github.com>
Sat, 25 Mar 2023 07:44:05 +0000 (09:44 +0200)
Doc/c-api/weakref.rst
Doc/library/gzip.rst

index cb6aba33b56817f4e4336b411d5478e5c2721535..b471260e17690caf6acb5c094a490e573d77cee0 100644 (file)
@@ -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.
index 33c40676f747c57bdd494f17c7c5cf71ee28e956..ec92fa2611bc4ce1ea3305993df98ab47fac6caf 100644 (file)
@@ -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.