[Python-ideas] Consider making enumerate a sequence if its argument is a sequence
Akira Li
4kir4.1i at gmail.com
Thu Oct 1 07:59:24 CEST 2015
Random832 <random832 at fastmail.com> writes:
> Akira Li <4kir4.1i at gmail.com> writes:
>> I don't remember ever using "non-iterator iterable". "non-iterator
>> iterable" does not qualify as more specific. You need to introduce new
>> requirements to the type for that.
>
> The question is, how do you *simply* state the very common requirement
> for an iterable to not behave in a specific undesirable way that all
> iterators do, and that it is very uncommon for any iterable other than
> an iterator to do? Are you opposed to having a word for this concept at
> all, or do you just not like the terms other people are suggesting?
That term is **iterable**. As I already said:
Specific application may use more specific requirements e.g.:
list(iterable):
- does it mean that all iterables must be finite?
- do we need a special word to describe what list() accepts?
set(iterable):
- does it mean that all iterables must yield hashable items?
- do we need a special word to describe what set() accepts?
dict(iterable):
- does it mean that all iterables must yield pairs?
- do we need a special word to describe what dict() accepts?
You've got the idea: the word *iterable* may be used in the context when
not all iterables are accepted.
https://mail.python.org/pipermail/python-ideas/2015-October/036692.html
More information about the Python-ideas
mailing list