The voodoo of zip(*someList)

David Wilson dw at botanicus.net
Mon Aug 30 10:29:55 CEST 2004


David Wilson wrote:

> In other words, it allows you to programmatically build an argument 
> list. Similarly,
>
>    your_mapping = { 'cmpfunc': lambda x: x }
>    some_list = [ 3, 1, 6, 2 ]
>    some_list.sort(**your_mapping)
>
> is equivalent to:
>
>    zip(cmpfunc = lambda x: x)

    some_list = [ 3, 1, 6, 2 ]
    some_list.sort(cmpfunc = lambda x: x)

There's nothing more confusing when you are trying to learn than an 
incorrect example. My apologies, lacking sleep here. :)


David.



More information about the Python-list mailing list