[Python-Dev] Termination of two-arg iter()
Aahz
aahz@pythoncraft.com
Mon, 15 Jul 2002 22:06:12 -0400
On Tue, Jul 16, 2002, Delaney, Timothy wrote:
> From: Aahz [mailto:aahz@pythoncraft.com]
>> On Tue, Jul 16, 2002, Delaney, Timothy wrote:
>>>
>>> I think the definition that some people are using is:
> ^^^^^
>>>
>>> An exhausted iterator is one for which StopIteration has
>>>
>>> An empty iterator OTOH is one which will raise
>>
>> In order to draw this distinction, you have to change the definition
>> of "iterator" that we've been using. The sole protocol of iterator
>> to date has been the existence of a next() method that either returns
>> an item or raises StopIteration. Making statements about what an
>> iterator *will* do counts as abuse IMO. If you want a feature
>> like that, go use something else -- don't break the simplicity of
>> iterators.
>
> Aahz - you did read the next paragraph didn't you.
>
> "... I don't see a lot of point in distinguishing between the two
> above cases."
Sorry for being unclear; that was the generic "you", not pointing at you
(Tim) specifically. s/you/one/
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
Project Vote Smart: http://www.vote-smart.org/