5 Aug
2015
5 Aug
'15
1:34 a.m.
On Wed, Aug 5, 2015 at 11:32 AM, Joonas Liik <liik.joonas@gmail.com> wrote:
no opinion if its a good idea or not, however, if iterator + iterator...
iterator * number
Almost completely useless. Multiplying an *iterable* by an integer will often be useful (eg multiplying list by int), but multiplying an *iterator* (or even just adding one to itself) is going to be useless, because the first time through it will exhaust it, and any well-behaved iterator will remain exhausted once it's ever raised StopIteration. (Note that the 'class iter' that I posted earlier is NOT well-behaved. You can add something onto an exhausted iterator and rejuvenate it. It'd take a couple extra lines of code to fix that.) ChrisA