built in zip function speed

mart.franklin at gmail.com mart.franklin at gmail.com
Tue Jul 4 11:31:17 EDT 2006


Fredrik Lundh wrote:
> mart.franklin at gmail.com wrote:
>
> > ## just for a laugh my own zip function
> > ## the joke is it runs faster than built in zip ??
>
> since it doesn't do the same thing, it's not a very good joke.
>
> > def myzip(*args):
> >     index = 0
> >     for elem in args[0]:
> >         zipper = []
> >         for arg in args:
> >             zipper.append(arg[index])
> >         index = index +1
> >         yield zipper
> 
> </F>

indeed, the joke is on me ;)  I thanks for pointing it out




More information about the Python-list mailing list