[Python-ideas] Aid reiteration with new class: gfic

Paul Moore p.f.moore at gmail.com
Sun Jun 21 16:50:17 CEST 2009


2009/6/21 Terry Reedy <tjreedy at udel.edu>:
> Nick Coghlan wrote:
>> 1. I've never seen a function parameter spec'ed as iterable vs
>> reiterable. It's always iterable vs sequence.
>
> The latter could be over-spec'ed because people are used to that being the
> choice, or because 'sequence' is being used as a synonym for 'reiterable'
> even though it implies more than is needed.

OTOH, it could be because "reiterable" isn't a commonly used concept
in Python. It's not entirely clear to me why this is, maybe it's
because it's not actually that useful, maybe it's because it's hard to
define clearly, or maybe there's another reason.

But to some extent this whole thread has the same sort of "solution
looking for a problem" feel that earlier threads about reiterability
have had.

FWIW, the difference between iterators and reiterables is similar to
that between C++ input iterators and forward iterators. So it may be
worth looking to that in the quest for use cases. However,
itertools.tee may cover a number of cases that would need a forward
iterator in C++.

Paul.



More information about the Python-ideas mailing list