Skip to content
Closed
Changes from 4 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
10 changes: 9 additions & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ addressof(cdata)
pointer(cdata)

POINTER(ctype)
- This factory function creates and returns a new ctypes pointer type.


bytes(cdata)
- return the buffer contents as a sequence of bytes (which is currently a string)
Expand Down Expand Up @@ -4814,7 +4816,13 @@ PyTypeObject PyCArray_Type = {
0, /* tp_setattro */
&PyCData_as_buffer, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
PyDoc_STR("XXX to be provided"), /* tp_doc */
PyDoc_STRVAR(array_doc,
Copy link
Contributor

@CharlieZhao95 CharlieZhao95 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is here. Please take a look at the usage of PyDoc_STRVAR, you can search this in the source code of cpython :)

BTW. There is already a similar PR here.

"Abstract base class for arrays.\n"
"\n"
"The recommended way to create \n"
"concrete array types is by multiplying \n"
"any ctypes data type with a non-negative \n"
"integer.\n"), /* tp_doc */
(traverseproc)PyCData_traverse, /* tp_traverse */
(inquiry)PyCData_clear, /* tp_clear */
0, /* tp_richcompare */
Expand Down