News for hackers. Stuff that matters.
Re:Brilliant or insane code? by raphael_kimmig on Sunday September 01, 2013 @07:54AM (#6310003)
You can also do

    zip(arr[::3], arr[1::3], arr[2::3])
which is nearly as fast but doesn't work with iterators. If you want to use iterators you could also do

    zip(islice(arr, 0, None, 3), islice(arr, 1, None, 3), islice(arr, 2, None, 3))
which is a tad slower.

There are no comments on this comment yet.