On Dec 20, 12:04 am, Anh Hai Trinh <anh.hai.tr...@gmail.com> wrote:

> chain:
>
>   sorted(itertools.chain(listagent(x)[::2], listagent(y)[-1:1:-2]))
>   [0, 4, 8, 12, 13, 15, 16, 17, 19]
>
> zip:
>
>   sorted(itertools.izip(listagent(z)[1::3], listagent(x)[2::3]))
>   [(452, 16), (758, 4), (898, 10)]

I think I mis-interpret Andrei's slides. I think what he meant to sort
a chain of slices is such that to move the smaller elements into the
first-given slices in-place, thus moving items around whatever lists
underlying those slices.

And for zip, I think he meant sort the first slice, but moving in-
place the items referred by the others in lock-step.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to