Message24280
Logged In: YES
user_id=1038590
Raymond's point about opaqueness is well-taken, since the
given partitioning behaviour in the example was actually
what was intended (I was part of the relevant c.l.p discussion).
For future reference, the reliable approach is to use a
generator function instead:
from itertools import islice
def partition(iterable, part_len):
itr = iter(iterable)
while 1:
yield tuple(islice(itr, part_len))
|
|
Date |
User |
Action |
Args |
2007-08-23 14:29:31 | admin | link | issue1121416 messages |
2007-08-23 14:29:31 | admin | create | |
|