Brilliant or insane code?

Oscar Benjamin oscar.j.benjamin at gmail.com
Tue Mar 17 21:38:09 EDT 2015


On 18 March 2015 at 00:35, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> I've just come across this
> http://www.stavros.io/posts/brilliant-or-insane-code/ as a result of this
> http://bugs.python.org/issue23695
>
> Any and all opinions welcomed, I'm chickening out and sitting firmly on the
> fence.

It seems fine to me. The code in question was rightly put into a
sensibly named function to avoid confusion (although the doc-string is
a little confusing).

The timing comparison with numpy.reshape is unfair though:
numpy.reshape is for working with numpy arrays and is vastly more
efficient than the zip method when used as intended.


Oscar



More information about the Python-list mailing list