summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/iter.rst
diff options
context:
space:
mode:
authorWilliam Ayd <william.ayd@icloud.com>2019-12-25 04:25:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2019-12-25 04:25:56 (GMT)
commit5c7ed7550ec2da16d7679e538fcd7c1a5631811f (patch)
treef92abd9e10bef96c8daa2f08c1e9030882cde1ee /Doc/c-api/iter.rst
parent025eeaa19607b2a80c979668dad405f567444573 (diff)
downloadcpython-5c7ed7550ec2da16d7679e538fcd7c1a5631811f.zip
cpython-5c7ed7550ec2da16d7679e538fcd7c1a5631811f.tar.gz
cpython-5c7ed7550ec2da16d7679e538fcd7c1a5631811f.tar.bz2
Minor C API documentation improvements. (GH-17696)
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
Diffstat (limited to 'Doc/c-api/iter.rst')
-rw-r--r--Doc/c-api/iter.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst
index 0224d37..a2992b3 100644
--- a/Doc/c-api/iter.rst
+++ b/Doc/c-api/iter.rst
@@ -29,7 +29,7 @@ something like this::
/* propagate error */
}
- while (item = PyIter_Next(iterator)) {
+ while ((item = PyIter_Next(iterator))) {
/* do something with item */
...
/* release reference when done */