Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80705

Re: What does zip mean?

From giacomo boffi <pecore@pascolo.net>
Newsgroups comp.lang.python
Subject Re: What does zip mean?
Date 2014-11-13 23:10 +0100
Organization The Sun and the Rain.
Message-ID <87a93uiwen.fsf@pascolo.net> (permalink)
References <baab02ae-09b4-4b9c-8e29-50e2581f9a7b@googlegroups.com> <m3qq8m$e0n$1@speranza.aioe.org> <m3qs33$n66$1@reader1.panix.com>

Show all headers | View raw


Grant Edwards <invalid@invalid.invalid> writes:

> No, you don't. That's not how a zipper works.  Each tooth from side A,
> isn't bound with one from side B.  It's bound with _two_ of them from
> side B. And each of those is in turn bound with an additional tooth
> from side A, and so on...
>
>> In your program you have two lists, whose elements `zip` returns
>> bound together in pairs
>
> What the zipper on a coat does is convert two separate sequences into
> a single sequence where the members alternate between the two input
> sequences.  IOW if we want to do something analogous to a zipper
> fastener it should do this:
>
>   zip([a,b,c,d,e,f],[1,2,3,4,5,6])  => [a,1,b,2,c,3,d,4,e,5,f,6]
>   
> Item '1' is bound equally to item 'a' and 'b'.  Item 'b' is bound
> equally to item '1' and '2'.

I love you folks of CLP

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What does zip mean? satishmlmlml@gmail.com - 2014-11-09 02:44 -0800
  Re: What does zip mean? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-09 21:58 +1100
    Re: What does zip mean? milos zorica <miloshzorica@gmail.com> - 2014-11-09 08:06 -0300
  Re: What does zip mean? giacomo boffi <giacomo_boffi@inwind.it> - 2014-11-10 17:48 +0100
    Re: What does zip mean? Grant Edwards <invalid@invalid.invalid> - 2014-11-10 17:19 +0000
      Re: What does zip mean? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-11 10:04 +1300
      Re: What does zip mean? Cameron Simpson <cs@zip.com.au> - 2014-11-11 07:36 +1100
      Re: What does zip mean? Terry Reedy <tjreedy@udel.edu> - 2014-11-10 19:39 -0500
      Re: What does zip mean? giacomo boffi <pecore@pascolo.net> - 2014-11-13 23:10 +0100
      Re: What does zip mean? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-14 22:06 +1100

csiph-web