[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

Raymond Hettinger report at bugs.python.org
Mon Apr 12 20:08:00 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

I think the docs are fine as-is.  At that point in the tutorial, we're trying to teach what the iterator protocol is.

The considerations of what makes a good design can be discussed elsewhere.  It is not a one-liner.  For example, files are self iterators but lists are not -- there are good reasons for either choice.  Explaining those design choices is not a good way to *introduce* the iterator protocol.

Recommend closing this report.

----------
nosy: +rhettinger
priority: normal -> low

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8376>
_______________________________________


More information about the Python-bugs-list mailing list