R. David Murray added the comment:

I just had a colleague get confused about the container returning self, and he 
was referring to the iterator protocol docs at 
https://docs.python.org/3.6/library/stdtypes.html#iterator.__iter__.  If you 
don't read that section with your thinking cap firmly in place it is easy to 
get confused about what "the iterator itself" means there.  I think it would be 
beneficial to add a sentence about the iterator state needing to be independent 
for each iterator returned by the *container's* __iter__.  A similar sentence 
in the tutorial might be all that is needed as well.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8376>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to