summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorOleg Iarygin <oleg@arhadthedev.net>2022-04-18 03:39:32 (GMT)
committerGitHub <noreply@github.com>2022-04-18 03:39:32 (GMT)
commita573cb2fec664c645ab744658d7e941d72e1a398 (patch)
treea44303e326da2ea7406397c6640cf0d51ab3eb43 /Doc
parent328dbc051f84bd5fdf61101bb4fa61d85f8b7feb (diff)
downloadcpython-a573cb2fec664c645ab744658d7e941d72e1a398.zip
cpython-a573cb2fec664c645ab744658d7e941d72e1a398.tar.gz
cpython-a573cb2fec664c645ab744658d7e941d72e1a398.tar.bz2
gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)
Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/typeobj.rst8
-rw-r--r--Doc/extending/newtypes_tutorial.rst4
-rw-r--r--Doc/includes/custom.c2
-rw-r--r--Doc/includes/custom2.c2
-rw-r--r--Doc/includes/custom3.c2
-rw-r--r--Doc/includes/custom4.c2
-rw-r--r--Doc/includes/sublist.c2
7 files changed, 11 insertions, 11 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 4a54139..ed434d8 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -2597,7 +2597,7 @@ A basic :ref:`static type <static-types>`::
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "mymod.MyObject",
.tp_basicsize = sizeof(MyObject),
- .tp_doc = "My objects",
+ .tp_doc = PyDoc_STR("My objects"),
.tp_new = myobj_new,
.tp_dealloc = (destructor)myobj_dealloc,
.tp_repr = (reprfunc)myobj_repr,
@@ -2627,7 +2627,7 @@ with a more verbose initializer::
0, /* tp_setattro */
0, /* tp_as_buffer */
0, /* tp_flags */
- "My objects", /* tp_doc */
+ PyDoc_STR("My objects"), /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
@@ -2660,7 +2660,7 @@ A type that supports weakrefs, instance dicts, and hashing::
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "mymod.MyObject",
.tp_basicsize = sizeof(MyObject),
- .tp_doc = "My objects",
+ .tp_doc = PyDoc_STR("My objects"),
.tp_weaklistoffset = offsetof(MyObject, weakreflist),
.tp_dictoffset = offsetof(MyObject, inst_dict),
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
@@ -2688,7 +2688,7 @@ to create instances (e.g. uses a separate factory func) using
.tp_name = "mymod.MyStr",
.tp_basicsize = sizeof(MyStr),
.tp_base = NULL, // set to &PyUnicode_Type in module init
- .tp_doc = "my custom str",
+ .tp_doc = PyDoc_STR("my custom str"),
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.tp_repr = (reprfunc)myobj_repr,
};
diff --git a/Doc/extending/newtypes_tutorial.rst b/Doc/extending/newtypes_tutorial.rst
index 9049153..34c25d1 100644
--- a/Doc/extending/newtypes_tutorial.rst
+++ b/Doc/extending/newtypes_tutorial.rst
@@ -90,7 +90,7 @@ The second bit is the definition of the type object. ::
static PyTypeObject CustomType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "custom.Custom",
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
.tp_basicsize = sizeof(CustomObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
@@ -161,7 +161,7 @@ you will need to OR the corresponding flags.
We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
To enable object creation, we have to provide a :c:member:`~PyTypeObject.tp_new`
handler. This is the equivalent of the Python method :meth:`__new__`, but
diff --git a/Doc/includes/custom.c b/Doc/includes/custom.c
index f361baf..26ca754 100644
--- a/Doc/includes/custom.c
+++ b/Doc/includes/custom.c
@@ -9,7 +9,7 @@ typedef struct {
static PyTypeObject CustomType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "custom.Custom",
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
.tp_basicsize = sizeof(CustomObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
diff --git a/Doc/includes/custom2.c b/Doc/includes/custom2.c
index 5bacab7..2a3c59f 100644
--- a/Doc/includes/custom2.c
+++ b/Doc/includes/custom2.c
@@ -98,7 +98,7 @@ static PyMethodDef Custom_methods[] = {
static PyTypeObject CustomType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "custom2.Custom",
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
.tp_basicsize = sizeof(CustomObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
diff --git a/Doc/includes/custom3.c b/Doc/includes/custom3.c
index 2b7a99e..5a47530 100644
--- a/Doc/includes/custom3.c
+++ b/Doc/includes/custom3.c
@@ -148,7 +148,7 @@ static PyMethodDef Custom_methods[] = {
static PyTypeObject CustomType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "custom3.Custom",
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
.tp_basicsize = sizeof(CustomObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
diff --git a/Doc/includes/custom4.c b/Doc/includes/custom4.c
index 584992f..c7ee555 100644
--- a/Doc/includes/custom4.c
+++ b/Doc/includes/custom4.c
@@ -160,7 +160,7 @@ static PyMethodDef Custom_methods[] = {
static PyTypeObject CustomType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "custom4.Custom",
- .tp_doc = "Custom objects",
+ .tp_doc = PyDoc_STR("Custom objects"),
.tp_basicsize = sizeof(CustomObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
diff --git a/Doc/includes/sublist.c b/Doc/includes/sublist.c
index b2c26e7..b36dadf 100644
--- a/Doc/includes/sublist.c
+++ b/Doc/includes/sublist.c
@@ -31,7 +31,7 @@ SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)
static PyTypeObject SubListType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "sublist.SubList",
- .tp_doc = "SubList objects",
+ .tp_doc = PyDoc_STR("SubList objects"),
.tp_basicsize = sizeof(SubListObject),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,