2008/11/17 Raymond Hettinger <report@bugs.python.org>

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

Feature :-)

You will get the expected result if you skip the step where you ran the
for-loop over r before running list().  Either listing or for-looping
will exhaust the iterator.  This is how iterators work.

----------
nosy: +rhettinger
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4337>
_______________________________________

Thanks for the reply and sorry for the noise. Indeed, you are right and for some "strange personal reasons" (bad habits?), I frequently fall in this trap.

>>> def plus(i):
    return i + 1

>>> list(map(plus, range(4)))
[1, 2, 3, 4]
>>>

Regards