[Python-Dev] Iterator addition?

Greg Ewing greg@cosc.canterbury.ac.nz
Tue, 31 Jul 2001 10:05:22 +1200 (NZST)


> The *only* thing that iterators and sequences have in common is that
> they can be iterated over.  So they are substitutable in all context
> where that's all you do -- including sequence (not tuple!) unpacking.
> And not in any other contexts.

I agree. The more special cases we add to try to make
iterators look like sequences, the harder it's going to
be to remember what you can and can't do with an iterator.
Let's keep it as simple as possible.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+