From b5ca84e6077009e706a9932579c422f0dad1362c Mon Sep 17 00:00:00 2001 From: William Ayd Date: Tue, 24 Dec 2019 23:25:56 -0500 Subject: [PATCH] [2.7] 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. (cherry picked from commit 5c7ed7550ec2da16d7679e538fcd7c1a5631811f) Co-authored-by: William Ayd --- Doc/c-api/iter.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index fb2a71cf1a825a..4f708829a89e40 100644 --- a/Doc/c-api/iter.rst +++ b/Doc/c-api/iter.rst @@ -36,7 +36,7 @@ something like this:: /* propagate error */ } - while (item = PyIter_Next(iterator)) { + while ((item = PyIter_Next(iterator))) { /* do something with item */ ... /* release reference when done */