Terry J. Reedy <tjre...@udel.edu> added the comment: Replace 'sequence' with 'collection' and I agree. The for loop code just calls iter() and it.next() until an exception. The behavior of it.next for builtins should be documented with the builtins. (I think there is something already about dict iteration in the dict entry.)
I agree we should say that the list iterator checks the internal index against the current .__len__() on each .next call. I had not thought about the usefullness of doing that for breadth-first search, so yes, mention that. ---------- nosy: +terry.reedy versions: -Python 2.7, Python 3.4, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32767> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com