[Tutor] Fastest way to iterate through a file

elis aeris hunter92383 at gmail.com
Sun Jul 1 22:38:48 CEST 2007


> The for version, as claimed by
>
> http://www.python.org/doc/essays/list2str.html

The fastest version of the algorithm is this one:


> In [4]:import array
>
> In [5]:def f7(list):
>   .5.:  return array.array('B', list).tostring()
>   .5.:
>
> In [6]:f7([97, 98, 99])
> Out[6]:'abc'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070701/06cc9dc2/attachment.htm 


More information about the Tutor mailing list