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


Groups > comp.lang.python > #85275

Re: meaning of: line, =

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: meaning of: line, =
Date Fri, 06 Feb 2015 12:30:39 +1300
Lines 23
Message-ID <cjicp2Fu029U1@mid.individual.net> (permalink)
References <CAPTjJmpqx1Cmm89Lg6-XL4-xdM+xD6=GHKvWb2zYTe4=11ZPPg@mail.gmail.com> <mailman.18464.1423061056.18130.python-list@python.org> <07f4498c-7917-4315-85d4-73283a830f2d@googlegroups.com> <matlbh$r0s$1@ger.gmane.org> <CAPTjJmp=b2ZA8eqvyf3tqK+0MHqOgS-PAG+ELNNOwuKKPq4FJQ@mail.gmail.com> <mailman.18488.1423127457.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net sn574PHk7SWHJKVNpJaIKwyUobbAGOw9nTmE99JHX6UWj2k4cN
Cancel-Lock sha1:8z9IyYB0VNsU5AK1CtynvcdpLYg=
User-Agent Mozilla Thunderbird 1.0.5 (Macintosh/20050711)
X-Accept-Language en-us, en
In-Reply-To <mailman.18488.1423127457.18130.python-list@python.org>
Xref csiph.com comp.lang.python:85275

Show key headers only | View raw


Devin Jeanpierre wrote:
> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico <rosuav@gmail.com> wrote:
> 
>>On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <__peter__@web.de> wrote:
>>
>>>>>>>[result] = f()
>>>>>>result
>>
>>Huh, was not aware of that alternate syntax.
> 
> Nor are most people. Nor is Python, in some places -- it seems like
> people forgot about it when writing some bits of the grammar.

If I remember correctly, it's left over from long ago
when you had to use tuple syntax to unpack tuples and
list syntax to unpack lists (and you couldn't unpack
anything else).

When the iterator protocol was introduced, the two
became equivalent.

-- 
Greg

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


Thread

Re: meaning of: line, = Albert-Jan Roskam <fomcl@yahoo.com> - 2015-02-04 14:38 +0000
  Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-04 07:09 -0800
    Re: meaning of: line, = Peter Otten <__peter__@web.de> - 2015-02-04 18:36 +0100
    Re: meaning of: line, = Chris Angelico <rosuav@gmail.com> - 2015-02-05 08:18 +1100
    Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-05 01:10 -0800
      Re: meaning of: line, = Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-05 20:40 +1100
        Re: meaning of: line, = Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-05 09:08 -0700
          Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-05 08:45 -0800
            Re: meaning of: line, = Skip Montanaro <skip.montanaro@gmail.com> - 2015-02-05 10:56 -0600
            Re: meaning of: line, = Tim Chase <python.list@tim.thechases.com> - 2015-02-05 11:00 -0600
            Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-05 08:59 -0800
              Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-06 05:09 -0800
                Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-06 05:20 -0800
                Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-06 06:03 -0800
        Re: meaning of: line, = Tim Chase <python.list@tim.thechases.com> - 2015-02-05 10:21 -0600
        Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-05 17:12 -0800
        Re: meaning of: line, = Chris Angelico <rosuav@gmail.com> - 2015-02-06 12:17 +1100
          Re: meaning of: line, = Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-06 17:52 +1300
      Re: meaning of: line, = Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-06 12:30 +1300

csiph-web