Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 4
    what do you mean by fresh iterator? Commented Feb 6, 2017 at 15:26
  • 25
    @lmiguelvargasf "Fresh" as in "new and unconsumed" as opposed to "exhausted or partially consumed". The idea is that a new iterator starts at the beginning, while a partially used iterator picks up where it left off. Commented Feb 7, 2017 at 3:15
  • 2
    Your 2nd, 3rd, and 4th bullets clearly indicate what you mean, in terms of specific python constructs or built-ins or method calls. But the 1st bullet ("anything that can be looped over") doesn't have that clarity. Also, the 1st bullet seems to have an overlap with the 2nd bullet, since the 2nd bullet is about for loops, and the 1st bullet is about "looping over". Could you pls address these? Commented Feb 19, 2019 at 4:58
  • 10
    Pls consider re-phrasing "anything your can call with iter()" as "anything you can pass to iter()" Commented Feb 19, 2019 at 5:07
  • 3
    What would be an example of an iterable without __iter__() method? (with just a __getitem__()?) Commented Jul 13, 2020 at 11:59