Message76001
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.
return i + 1
[1, 2, 3, 4]
>>>
Regards |
File name |
Uploaded |
unnamed
|
jmfauth,
2008-11-18.07:35:21
|
|
Date |
User |
Action |
Args |
2008-11-18 07:35:24 | jmfauth | set | recipients:
+ jmfauth, rhettinger |
2008-11-18 07:35:23 | jmfauth | link | issue4337 messages |
2008-11-18 07:35:23 | jmfauth | create | |
|