File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,10 @@ complete listing.
177
177
.. c :macro :: PyDoc_STRVAR(name, str)
178
178
179
179
Creates a variable with name ``name `` that can be used in docstrings.
180
+ If Python is built without docstrings, the value will be empty.
180
181
181
- Use the :c:macro: `PyDoc_STRVAR ` or :c:macro: `PyDoc_STR ` macros for
182
- docstrings to support building Python without docstrings,
183
- as specified in :pep: `7 `.
182
+ Use :c:macro: `PyDoc_STRVAR ` for docstrings to support building
183
+ Python without docstrings, as specified in :pep: `7 `.
184
184
185
185
Example::
186
186
@@ -192,6 +192,22 @@ complete listing.
192
192
// ...
193
193
}
194
194
195
+ .. c :macro :: PyDoc_STR(str)
196
+
197
+ Creates a docstring for the given input string or an empty string
198
+ if docstrings are disabled.
199
+
200
+ Use :c:macro: `PyDoc_STR ` in specifying docstrings to support
201
+ building Python without docstrings, as specified in :pep: `7 `.
202
+
203
+ Example::
204
+
205
+ static PyMethodDef pysqlite_row_methods[] = {
206
+ {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS,
207
+ PyDoc_STR("Returns the keys of the row.")},
208
+ {NULL, NULL}
209
+ };
210
+
195
211
.. _api-objects :
196
212
197
213
Objects, Types and Reference Counts
You can’t perform that action at this time.
0 commit comments