[Python-ideas] __iter__ implies __contains__?
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Oct 3 23:07:51 CEST 2011
Guido van Rossum wrote:
> Actually I think there is at least *some* trend in the opposite
> direction -- we now have a much more refined library (and even
> vocabulary) for "iterator algebra" than before iter() was introduced,
> and a subgroup of the community who can easily whip out clever ways to
> do things by combining iterators in new ways.
Hmmm, not sure what to do about that.
Maybe we should be thinking about a "reiterator algebra"
to sit on top of the iterator algebra.
For example, given two reiterables x and y, zip(x, y)
would return a reiterable that, when iterated over, would
extract iterators from x and y and return a corresponding
iterator.
--
Greg
More information about the Python-ideas
mailing list