Skip to content

[3.10] bpo-45250: fix docs regarding __iter__ and iterators being inconsistently required by CPython (GH-29170)#29650

Merged
brettcannon merged 1 commit intopython:3.10from
brettcannon:backport-be36e06-3.10
Nov 22, 2021
Merged

[3.10] bpo-45250: fix docs regarding __iter__ and iterators being inconsistently required by CPython (GH-29170)#29650
brettcannon merged 1 commit intopython:3.10from
brettcannon:backport-be36e06-3.10

Conversation

@brettcannon
Copy link
Copy Markdown
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