8000 Minor C API documentation improvements. (GH-17697) · python/cpython@e9039f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit e9039f3

Browse files
miss-islingtonWillAyd
authored andcommitted
Minor C API documentation improvements. (GH-17697)
The added parentheses around the PyIter_Next assignment suppress the following warning which gcc throws without: ``` warning: using the result of an assignment as a condition without parentheses [-Wparentheses] ``` The other change is a typo fix (cherry picked from commit 5c7ed75) Co-authored-by: William Ayd <william.ayd@icloud.com>
1 parent 4ed79b7 commit e9039f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/c-api/iter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ something like this::
2929
/* propagate error */
3030
}
3131
32-
while (item = PyIter_Next(iterator)) {
32+
while ((item = PyIter_Next(iterator))) {
3333
/* do something with item */
3434
...
3535
/* release reference when done */

Doc/includes/custom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PyInit_custom(void)
3737
Py_INCREF(&CustomType);
3838
if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) {
3939
Py_DECREF(&CustomType);
40-
PY_DECREF(m);
40+
Py_DECREF(m);
4141
return NULL;
4242
}
4343

0 commit comments

Comments
 (0)
0