KEMBAR78
[3.10] bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170) by brettcannon · Pull Request #29650 · python/cpython · GitHub
Skip to content

Conversation

@brettcannon
Copy link
Member

@brettcannon brettcannon commented Nov 20, 2021

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 be36e06)

Co-authored-by: Brett Cannon brett@python.org

https://bugs.python.org/issue45250

Automerge-Triggered-By: GH:brettcannon

…nconsistently required by CPython (pythonGH-29170)

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 be36e06)

Co-authored-by: Brett Cannon <brett@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants