From 51665ac281c3361e6891608d825a47e1970c9b86 Mon Sep 17 00:00:00 2001 From: Jake Wallin Date: Tue, 20 Oct 2026 02:21:05 +0000 Subject: [PATCH] gh-132177: Correct ctypes _objects ownership documentation --- Doc/library/ctypes.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index bafe00a6a95703..775c9782c281a9 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2627,10 +2627,12 @@ Data types .. attribute:: _objects - This member is either ``None`` or a dictionary containing Python objects - that need to be kept alive so that the memory block contents is kept - valid. This object is only exposed for debugging; never modify the - contents of this dictionary. + This member holds Python objects that need to be kept alive so that the + memory block contents remain valid. It is usually ``None`` or a dictionary, + but may be another object. For example, an instance created with + :meth:`from_buffer` may hold a :class:`memoryview` of the source buffer. + This attribute is only exposed for debugging. If it is a dictionary, + never modify its contents. .. _ctypes-fundamental-data-types-2: