Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added docstrings to abstract ctypes.
21 changes: 19 additions & 2 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down
Loading