Skip to content

Commit 7feffc2

Browse files
kiblik1ambv
authored andcommitted
add docstrings to abstract classes
1 parent 39bc958 commit 7feffc2

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

‎Modules/_ctypes/_ctypes.c‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5545,7 +5545,12 @@ Simple_repr(PyObject *self)
55455545

55465546
static PyType_Slot pycsimple_slots[] = {
55475547
{Py_tp_repr, &Simple_repr},
5548-
{Py_tp_doc, PyDoc_STR("XXX to be provided")},
5548+
{Py_tp_doc, PyDoc_STR("This non-public class is the base class of all "
5549+
"fundamental ctypes data types.\n"
5550+
"It contains the common attributes of the fundamental "
5551+
"ctypes data types.\n"
5552+
"_SimpleCData is a subclass of _CData, so it inherits "
5553+
"their methods and attributes.")},
55495554
{Py_tp_methods, Simple_methods},
55505555
{Py_tp_getset, Simple_getsets},
55515556
{Py_tp_init, Simple_init},
@@ -5986,7 +5991,19 @@ Pointer_bool(PyObject *self)
59865991
}
59875992

59885993
static PyType_Slot pycpointer_slots[] = {
5989-
{Py_tp_doc, (void *)PyDoc_STR("XXX to be provided")},
5994+
{Py_tp_doc, (void *)PyDoc_STR(
5995+
"Private, abstract base class for pointers.\n"
5996+
"\n"
5997+
"Concrete pointer types are created by calling POINTER() "
5998+
"with the type that will be pointed to; this is done "
5999+
"automatically by pointer().\n"
6000+
"\n"
6001+
"If a pointer points to an array, its elements can be read "
6002+
"and written using standard subscript and slice accesses. "
6003+
"Pointer objects have no size, so len() will raise "
6004+
"TypeError. Negative subscripts will read from the memory "
6005+
"before the pointer (as in C), and out-of-range subscripts "
6006+
"will probably crash with an access violation (if you’re lucky).")},
59906007
{Py_tp_getset, Pointer_getsets},
59916008
{Py_tp_init, Pointer_init},
59926009
{Py_tp_new, Pointer_new},

0 commit comments

Comments
 (0)