Skip to content

Commit 47af188

Browse files
authored
Add missing PyDoc_STR calls (#109393)
In files: * Modules/_ctypes/cfield.c * Modules/_struct.c * Objects/dictobject.c * Objects/typevarobject.c * Objects/unionobject.c
1 parent 5eec58a commit 47af188

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

Modules/_ctypes/cfield.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ PyCField_get_size(PyObject *self, void *data)
250250
}
251251

252252
static PyGetSetDef PyCField_getset[] = {
253-
{ "offset", PyCField_get_offset, NULL, "offset in bytes of this field" },
254-
{ "size", PyCField_get_size, NULL, "size in bytes of this field" },
253+
{ "offset", PyCField_get_offset, NULL, PyDoc_STR("offset in bytes of this field") },
254+
{ "size", PyCField_get_size, NULL, PyDoc_STR("size in bytes of this field") },
255255
{ NULL, NULL, NULL, NULL },
256256
};
257257

Modules/_struct.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2198,8 +2198,8 @@ static PyMemberDef s_members[] = {
21982198
};
21992199

22002200
static PyGetSetDef s_getsetlist[] = {
2201-
{"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL},
2202-
{"size", (getter)s_get_size, (setter)NULL, "struct size in bytes", NULL},
2201+
{"format", (getter)s_get_format, (setter)NULL, PyDoc_STR("struct format string"), NULL},
2202+
{"size", (getter)s_get_size, (setter)NULL, PyDoc_STR("struct size in bytes"), NULL},
22032203
{NULL} /* sentinel */
22042204
};
22052205

Objects/dictobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4643,7 +4643,7 @@ dictview_mapping(PyObject *view, void *Py_UNUSED(ignored)) {
46434643

46444644
static PyGetSetDef dictview_getset[] = {
46454645
{"mapping", dictview_mapping, (setter)NULL,
4646-
"dictionary that this view refers to", NULL},
4646+
PyDoc_STR("dictionary that this view refers to"), NULL},
46474647
{0}
46484648
};
46494649

Objects/typevarobject.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ paramspec_kwargs(PyObject *self, void *unused)
806806
}
807807

808808
static PyGetSetDef paramspec_getset[] = {
809-
{"args", (getter)paramspec_args, NULL, "Represents positional arguments.", NULL},
810-
{"kwargs", (getter)paramspec_kwargs, NULL, "Represents keyword arguments.", NULL},
809+
{"args", (getter)paramspec_args, NULL, PyDoc_STR("Represents positional arguments."), NULL},
810+
{"kwargs", (getter)paramspec_kwargs, NULL, PyDoc_STR("Represents keyword arguments."), NULL},
811811
{0},
812812
};
813813

Objects/unionobject.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ union_parameters(PyObject *self, void *Py_UNUSED(unused))
331331
}
332332

333333
static PyGetSetDef union_properties[] = {
334-
{"__parameters__", union_parameters, (setter)NULL, "Type variables in the types.UnionType.", NULL},
334+
{"__parameters__", union_parameters, (setter)NULL,
335+
PyDoc_STR("Type variables in the types.UnionType."), NULL},
335336
{0}
336337
};
337338

0 commit comments

Comments
 (0)