[Python-ideas] Introduce collections.Reiterable
Andrew Barnert
abarnert at yahoo.com
Fri Sep 20 09:51:03 CEST 2013
On Sep 19, 2013, at 20:18, Neil Girdhar <mistersheik at gmail.com> wrote:
> Therefore, I feel there should be a definitive test for reiterability. Either:
> * The documentation should promise that Iterable and not Iterator is reiterable, or
> * Reiterable should be added to collections.abc, or
> * some other definitive test that hasn't been brought up yet.
Everyone agrees that, in theory, someone could create a non-iterator Iterable that can only be iterated once.
The question is: has anyone ever done such a thing? (Intentionally, that is. Anyone who accidentally created a broken iterable wouldn't be helped by a new ABC--they can't protect against unintentionally broken semantics--and even less so by a documentation change.) Can you think of any good reason anyone might ever want to do such a thing?
If not, what are you hoping to protect against, and how do you hope this change to help you do so?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130920/ad9e2ca0/attachment.html>
More information about the Python-ideas
mailing list