Lambda the Ultimate

inactiveTopic PEP 323: Copyable Iterators
started 12/28/2003; 2:16:44 PM - last post 1/4/2004; 8:31:28 AM
Ehud Lamm - PEP 323: Copyable Iterators  blueArrow
12/28/2003; 2:16:44 PM (reads: 11595, responses: 1)
PEP 323: Copyable Iterators
Yet another language design discussion concerning a simple looking, and rather isolated, language construct.

In Python up to 2.3, most built-in iterator types don't let the user copy their instances. User-coded iterators that do let their clients call copy.copy on their instances may, or may not, happen to return, as a result of the copy, a separate iterator object that may be iterated upon independently from the original.

As more and more languages offer container libraries supporting iterators, and quite a few even support iterator expressions and generators, issues like this one are likely to arise more often.

Strangely, it's quite hard to define the state of the art regarding this and similar issues.

The discussion is more interesting than the PEP itself, and is fairly self contained.


Posted to Python by Ehud Lamm on 12/28/03; 2:18:43 PM

Mitchell N Charity - Re: PEP 323: Copyable Iterators  blueArrow
1/4/2004; 8:31:28 AM (reads: 90, responses: 0)
Ehud writes:
As more and more languages offer container libraries supporting iterators, and quite a few even support iterator expressions and generators, issues like this one are likely to arise more often.

Strangely, it's quite hard to define the state of the art regarding this and similar issues.

Perhaps a LtU wiki might help?

I've noticed the same unfortunate problem of balkanized language design discussion, and a state of the art poorly characterized, repeatedly reinvented, and often overlooked.

LtU may be one of the only places where the community might support, say, gnawing on iterators to determine just exactly what the design space looks like. Gathering links from multiple language communities' explorations.

But LtU's discussion format, while useful for this, is not sufficient. It doesn't lend itself to incrementally creating a synthesis of a discussion.