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
|