i = iter(array)
return zip(i, i, i)
There you go. All but neceessary magic gone with just one line more. i = iter(array)
return zip(i, i, i)
There you go. All but neceessary magic gone with just one line more.(and the original article is dealing with coords in graphics, which is "maths-related code" in my book, but perhaps not in everyone's)
It's OK here, but may bite you with a different function.
The left-to-right evaluation order of the
iterables is guaranteed.
http://docs.python.org/2/library/functions.html#zip