]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Doc: fix example for iter() function. (GH-11959)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 21 Feb 2019 07:59:28 +0000 (23:59 -0800)
committerGitHub <noreply@github.com>
Thu, 21 Feb 2019 07:59:28 +0000 (23:59 -0800)
commit92ac01b104b80f9251fcb17ab4cc1845c1f91ac2
tree9a5bf409a62b68b2f7bc239fba2ce180e48b0ea9
parent14baf06febb9194dd76f694ec359ce94708ed861
Doc: fix example for iter() function. (GH-11959)

read() returns bytes for a file opened in binary mode,
so b'' should be used as a sentinel instead of ''.
Otherwise the loop will be infinite.
(cherry picked from commit 11fa0e48a958716186eb99348a46064e944eccf6)

Co-authored-by: Cristian Ciupitu <cristian.ciupitu@yahoo.com>
Doc/library/functions.rst