Re: [Python-Dev] Rationale behind lazy map/filter

2015年10月13日 08:35:07 -0700

"R. David Murray" <[email protected]> writes:
> On 2015年10月13日 14:59:56 +0300, Stefan Mihaila
> <[email protected]> wrote:
>> Maybe it's just python2 habits, but I assume I'm not the only one
>> carelessly thinking that "iterating over an input a second time will 
>> result in the same thing as the first time (or raise an error)".
>
> This is the way iterators have always worked.
It does raise the question though of what working code it would actually
break to have "exhausted" iterators raise an error if you try to iterate
them again rather than silently yield no items.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to