]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently...
authorBrett Cannon <brett@python.org>
Mon, 22 Nov 2021 23:09:15 +0000 (15:09 -0800)
committerGitHub <noreply@github.com>
Mon, 22 Nov 2021 23:09:15 +0000 (15:09 -0800)
commit99aad31b7ad493d4feea04064bcd6b04061477f9
treeeaa5d4201bc97749a1fd44c568bd03f6452c5d22
parent56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2
[3.10] bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170) (GH-29650)

It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
(cherry picked from commit be36e0634060c7d5dee8e8876fb888bbb53d992a)

Co-authored-by: Brett Cannon <brett@python.org>
Doc/c-api/iter.rst
Doc/c-api/typeobj.rst
Doc/glossary.rst
Doc/library/functions.rst
Doc/library/stdtypes.rst
Doc/reference/datamodel.rst
Misc/NEWS.d/next/Documentation/2021-10-22-12-09-18.bpo-45250.Iit5-Y.rst [new file with mode: 0644]