Without my zip
trick:
def iter_counter(iterable):
counter = itl.count(1)
return (
itl.compress(iterable, counter),
map(opr.sub, counter, itl.count(1)).__next__
)
Without my zip
trick:
def iter_counter(iterable):
counter = itl.count(1)
return (
itl.compress(iterable, counter),
map(opr.sub, counter, itl.count(1)).__next__
)