[Python-checkins] [3.11] gh-101100: Document PyObject_ClearWeakRefs, gzip's name, and asyncio.iscoroutine (#103001)

hugovk webhook-mailer at python.org
Sat Mar 25 03:43:58 EDT 2023


https://github.com/python/cpython/commit/85c686a1a5f362908138139d8d332ce7c033f2aa
commit: 85c686a1a5f362908138139d8d332ce7c033f2aa
branch: 3.11
author: Hugo van Kemenade <hugovk at users.noreply.github.com>
committer: hugovk <hugovk at users.noreply.github.com>
date: 2023-03-25T09:43:52+02:00
summary:

[3.11] gh-101100: Document PyObject_ClearWeakRefs, gzip's name, and asyncio.iscoroutine (#103001)

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

diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst
index ace743ba01c5..f27ec4411b4a 100644
--- a/Doc/c-api/weakref.rst
+++ b/Doc/c-api/weakref.rst
@@ -67,3 +67,13 @@ as much as it can.
 .. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
 
    Similar to :c:func:`PyWeakref_GetObject`, but 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/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 1e0a69c75e25..02fc38495879 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -956,6 +956,13 @@ Introspection
    .. versionadded:: 3.7
 
 
+.. function:: iscoroutine(obj)
+
+   Return ``True`` if *obj* is a coroutine object.
+
+   .. versionadded:: 3.4
+
+
 Task Object
 ===========
 
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 8cea2649ee6c..9afaf86cb132 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