[Python-ideas] Consider making enumerate a sequence if its argument is a sequence
Akira Li
4kir4.1i at gmail.com
Fri Oct 2 03:47:45 CEST 2015
Random832 <random832 at fastmail.com> writes:
> On Thu, Oct 1, 2015, at 11:10, Steven D'Aprano wrote:
>> On Thu, Oct 01, 2015 at 08:15:25AM +0300, Akira Li wrote:
>>
...
>> Of course they don't necessarily do so, but those that don't are not
>> necessarily well-behaved.
>
> I think what he is claiming, more or less, is that there is not a
> universal notion of "well-behaved" (this is true), or indeed *any*
> broadly-applicable notions of "well-behaved" (this is false).
I would say that "well-behaved" "non-iterator iterable" is a strict
subset of "non-iterator iterable".
You probably want "reiterable" word that I see mentioned in the thread.
I don't know whether *reiterable* implies that it produces the same
items the second time but it certainly implies that
next(iter(reiterable)) _may produce something if_ list(reiterable) call
is successful. Perhaps *rerunnable* (that I also see mentioned in the
thread) more strongly implies that the same items should be produced.
More information about the Python-ideas
mailing list