On Mon, Jan 29, 2018 at 3:26 PM, Rowan Collins <rowan.coll...@gmail.com>
wrote:

>
> Nor are generators the only non-rewindable iterables you need to worry
> about, so really the only options you have are to only inspect arrays, or
> to add a big fat warning that the function may consume your iterable (or
> enter an infinite loop).
>
>
Sorry about the double reply.  What about using count() as a guard?  While
there might be some countable consumables, my understand of generators is
they are often used where no prior count is available. Arrays and
ArrayObjects are countable.

Reply via email to