Skip to content

Commit 7513c6b

Browse files
authored
[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002)
1 parent d3b4d3a commit 7513c6b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Doc/c-api/weakref.rst

+10
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,13 @@ as much as it can.
6868
6969
Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that does no
7070
error checking.
71+
72+
73+
.. c:function:: void PyObject_ClearWeakRefs(PyObject *object)
74+
75+
This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler
76+
to clear weak references.
77+
78+
This iterates through the weak references for *object* and calls callbacks
79+
for those references which have one. It returns when all callbacks have
80+
been attempted.

Doc/library/gzip.rst

+6
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ The module defines the following items:
143143
:func:`time.time` and the :attr:`~os.stat_result.st_mtime` attribute of
144144
the object returned by :func:`os.stat`.
145145

146+
.. attribute:: name
147+
148+
The path to the gzip file on disk, as a :class:`str` or :class:`bytes`.
149+
Equivalent to the output of :func:`os.fspath` on the original input path,
150+
with no other normalization, resolution or expansion.
151+
146152
.. versionchanged:: 3.1
147153
Support for the :keyword:`with` statement was added, along with the
148154
*mtime* constructor argument and :attr:`mtime` attribute.

0 commit comments

Comments
 (0)