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


Groups > comp.lang.python > #80705

Re: What does zip mean?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-2.dfn.de!news-1.dfn.de!news.dfn.de!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail
From giacomo boffi <pecore@pascolo.net>
Newsgroups comp.lang.python
Subject Re: What does zip mean?
Date Thu, 13 Nov 2014 23:10:56 +0100
Organization The Sun and the Rain.
Lines 22
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>
NNTP-Posting-Host ppp-9-2.21-151.libero.it
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace virtdiesel.mng.cu.mi.it 1415916657 10037 151.21.2.9 (13 Nov 2014 22:10:57 GMT)
X-Complaints-To abuse@diesel.cu.mi.it
NNTP-Posting-Date Thu, 13 Nov 2014 22:10:57 +0000 (UTC)
User-Agent Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b34 (linux)
Cancel-Lock sha1:PIkXVtnNMZVHL+ciHCIV9f1ddAE=
Xref csiph.com comp.lang.python:80705

Show key headers only | 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