[docs] [issue24624] Itertools documentation says iterator when iterable is intended

Steven D'Aprano report at bugs.python.org
Mon Jul 13 03:57:42 CEST 2015


Steven D'Aprano added the comment:

On Mon, Jul 13, 2015 at 01:37:26AM +0000, Neil Girdhar wrote:
> 
> New submission from Neil Girdhar:
> 
> In the description of the consume recipe:
[...]
> iterator should be replaced with iterable.  This function accepts strings for example, which are not iterators.

It *accepts* strings, but it doesn't consume them. It runs through the 
string, but the string still exists and you can iterate over it again 
and again and again.

The intent of the recipe is to consume an *iterator* not arbitrary 
iterables. I don't believe the recipe or its description needs to be 
changed.

----------
nosy: +steven.daprano

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


More information about the docs mailing list