> If you put a next method on an iterable you are most probably > confusing iterators and iterables and not just using the name 'next' > for some other innocent purpose. Quite to the contrary. You might have a multi-iterable class that was defined before the iterator protocol existed, and had a "built-in" iterator that keeps the iteration state in the object itself (a common design, e.g. BSD db files have this). This is OK for simple uses. But with iterators available the class might grow a proper iterator class that keeps state external from the object. But for backward compatibility reasons you cannot remove the next() method on the class itself. QED: you have a multi-iterable object that has both an __iter__ method and a next method. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4