[Tutor] optimization: faster than for
hunter92383 at gmail.com
Sun Jul 1 22:26:17 CEST 2007
ugh, can someone who is online at this time give me some pointers on how to
i don't know how to look it up,
in is listed,
out is not, so i am not sure if this is python at all.
On 7/1/07, Eike Welk <eike.welk at gmx.net> wrote:
> On Sunday 01 July 2007 06:17, elis aeris wrote:
> > The for version, as claimed by
> > http://www.python.org/doc/essays/list2str.html
> The fastest version of the algorithm is this one:
> In :import array
> In :def f7(list):
> .5.: return array.array('B', list).tostring()
> In :f7([97, 98, 99])
> The implicit loop is the "tostring" function. It is written in C and
> it happens to perform the desired algorithm. So there is nothing
> magical about "implicit loops". It just means: Find a library
> function that is written in C and that performs your task.
> For manipulating images it means: Find some operations in PIL that do
> what you want, and don't look at pixel values.
> Kind regards,
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor