On 10/1/2015 1:59 AM, Akira Li wrote:
Random832 firstname.lastname@example.org writes:
Akira Li email@example.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.:
- does it mean that all iterables must be finite?
- do we need a special word to describe what list() accepts?
- does it mean that all iterables must yield hashable items?
- do we need a special word to describe what set() accepts?
iterable_of_pairs (whose first member is hashable)
- does it mean that all iterables must yield pairs?
- do we need a special word to describe what dict() accepts?
Whatever word is used in the signature, the description should be in the doc and docstring, preferable in the first line.
Return a list with members from a finite iterable. Return a set with members from an iterable of hashable objects.* Return a string joining items from an iterable of strings.
*Also, equality between object should be transitive
You've got the idea: the word *iterable* may be used in the context when not all iterables are accepted.
Right. Each one should be documented properly.