On 9/30/2015 10:31 PM, Andrew Barnert via Python-ideas wrote:
On Sep 30, 2015, at 19:04, Akira Li email@example.com wrote:
Random832 firstname.lastname@example.org writes:
Akira Li email@example.com writes:
Andrew Barnert via Python-ideas firstname.lastname@example.org writes: ...
(The fact that we don't have a term for "non-iterator iterable", and
All iterators are iterable but some iterables are not iterators.
If your code accepts only iterators then use the term *iterator*. Otherwise the term *iterable* could be used.
It is misleading to use *iterable* if your code only accepts iterators.
If an iterable is an iterator; It is called *iterator*. The term *iterable* implies that some instances are not iterators.
There are three (well, three and a half) kinds of code that consume iterables, how would you describe each simply?
- Does not call iter, simply calls next. Therefore cannot consume a non-iterator iterable.
- Calls iter, but can accept an iterator (e.g. only goes through it once)
- Cannot accept an iterator (goes through it twice, or permanently stores a reference to it, etc)
re-iterable (with implication of same sequence of yields) I have used this for years on python list and do not think I am unique.
*iterable* is an object that you can pass to iter() to get *iterator*. An iterable does not guarantee that it yields the same items twice.
We don't have any way to simply describe this thing.
Depends of the 'we'.