[Python-Dev] Termination of two-arg iter()

Aahz aahz@pythoncraft.com
Mon, 15 Jul 2002 20:46:36 -0400


On Mon, Jul 15, 2002, Ka-Ping Yee wrote:
>
> 2.  Should an empty iterator be distinguishable from an exhausted iterator?
> 
> For 2, i believe Andrew and Oren want the answer to be "yes",
> but Guido and Aahz want the answer to be "no".  I think the answer
> should be "yes".  An exhausted iterator is not the same thing as
> a freshly-created iterator on an empty sequence, and allowing one
> to silently pass for the other is going to lead to problems.

I don't think I expressed an opinion on this, and if you think I did,
either you misunderstood me or I misunderstood what I was expounding on.
I also think that's the wrong question, given the nature of iterators;
before you can ask that question, you need to demonstrate that there is
in fact a difference between an empty iterator and an exhausted iterator.
I think that you can't demonstrate that, but I'm certainly willing to be
convinced.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/