mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Added ilen, a function to return the length of an iterator.
This commit is contained in:
parent
36996dd3cf
commit
031c81e937
@ -227,6 +227,12 @@ def window(L, size):
|
||||
for i in xrange(len(L) - (size-1)):
|
||||
yield L[i:i+size]
|
||||
|
||||
def ilen(iterator):
|
||||
i = 0
|
||||
for _ in iterator:
|
||||
i += 1
|
||||
return i
|
||||
|
||||
## def group(seq, groupSize):
|
||||
## L = []
|
||||
## LL = []
|
||||
|
Loading…
Reference in New Issue
Block a user