From 7feffc26cc77c77dbf140ab94734ca85044148d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0kopek?= Date: Mon, 4 Sep 2023 17:16:07 +0200 Subject: [PATCH 1/2] add docstrings to abstract classes --- Modules/_ctypes/_ctypes.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index ae49cbf3e57da7..19872f8678f7b0 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5545,7 +5545,12 @@ Simple_repr(PyObject *self) static PyType_Slot pycsimple_slots[] = { {Py_tp_repr, &Simple_repr}, - {Py_tp_doc, PyDoc_STR("XXX to be provided")}, + {Py_tp_doc, PyDoc_STR("This non-public class is the base class of all " + "fundamental ctypes data types.\n" + "It contains the common attributes of the fundamental " + "ctypes data types.\n" + "_SimpleCData is a subclass of _CData, so it inherits " + "their methods and attributes.")}, {Py_tp_methods, Simple_methods}, {Py_tp_getset, Simple_getsets}, {Py_tp_init, Simple_init}, @@ -5986,7 +5991,19 @@ Pointer_bool(PyObject *self) } static PyType_Slot pycpointer_slots[] = { - {Py_tp_doc, (void *)PyDoc_STR("XXX to be provided")}, + {Py_tp_doc, (void *)PyDoc_STR( + "Private, abstract base class for pointers.\n" + "\n" + "Concrete pointer types are created by calling POINTER() " + "with the type that will be pointed to; this is done " + "automatically by pointer().\n" + "\n" + "If a pointer points to an array, its elements can be read " + "and written using standard subscript and slice accesses. " + "Pointer objects have no size, so len() will raise " + "TypeError. Negative subscripts will read from the memory " + "before the pointer (as in C), and out-of-range subscripts " + "will probably crash with an access violation (if you’re lucky).")}, {Py_tp_getset, Pointer_getsets}, {Py_tp_init, Pointer_init}, {Py_tp_new, Pointer_new}, From 168d8a926a57217263f96358b65690840130354b Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:01:21 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Documentation/2023-09-04-16-01-20.gh-issue-107689.LFLFtG.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2023-09-04-16-01-20.gh-issue-107689.LFLFtG.rst diff --git a/Misc/NEWS.d/next/Documentation/2023-09-04-16-01-20.gh-issue-107689.LFLFtG.rst b/Misc/NEWS.d/next/Documentation/2023-09-04-16-01-20.gh-issue-107689.LFLFtG.rst new file mode 100644 index 00000000000000..5c60e29bc0b44a --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2023-09-04-16-01-20.gh-issue-107689.LFLFtG.rst @@ -0,0 +1 @@ +Added docstrings to abstract ctypes.