built in zip function speed

Fredrik Lundh fredrik at pythonware.com
Tue Jul 4 11:18:31 EDT 2006


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>




More information about the Python-list mailing list