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


Groups > comp.lang.python > #107458

Re: PEP proposal: sequence expansion support for yield statement: yield *

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: PEP proposal: sequence expansion support for yield statement: yield *
Date Fri, 22 Apr 2016 01:26:46 +1000
Lines 21
Message-ID <mailman.19.1461252410.23626.python-list@python.org> (permalink)
References <573e61523bfc412ca8674b06d70f2fd7@sraex01sc.sisa.samsung.com> <mailman.36.1461181657.12923.python-list@python.org> <57181d0e$0$1591$c3e8da3$5496439d@news.astraweb.com> <CAO1D73Fs6_U95TKsmytdH3wgnyUgrZHcaCk5J6xL__xia6U0Ww@mail.gmail.com> <CAPTjJmq86WzrEX++hfGRaTfs6XUf+pxF2XdxKKanh58q1AXzGA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de t1bdRFKxieZS3jXBmyy9OQ/4ozwbejA7WD8mD3S6jKkg==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'context': 0.05; 'subject:PEP': 0.07; 'cc:addr:python-list': 0.09; '22,': 0.09; 'generators': 0.09; 'optional': 0.09; 'semantics': 0.09; 'python': 0.10; 'syntax': 0.13; "'*'": 0.16; '2016': 0.16; '448': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'justin': 0.16; 'operators.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'send,': 0.16; 'subject:yield': 0.16; 'wrote:': 0.16; 'basically': 0.18; 'pointed': 0.18; '(in': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'proposed': 0.20; 'arguments': 0.22; 'subject:support': 0.22; 'am,': 0.23; 'code.': 0.23; 'needed.': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'mathematical': 0.27; 'pep': 0.29; 'url:peps': 0.29; 'allows': 0.30; '"the': 0.32; '[1]': 0.32; 'point': 0.33; 'url:python': 0.33; 'steven': 0.33; 'though.': 0.33; 'received:google.com': 0.35; 'url:dev': 0.35; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'agree': 0.37; 'received:209.85.213': 0.37; 'things': 0.38; 'received:209': 0.38; 'does': 0.39; 'some': 0.40; 'avoid': 0.61; 'more': 0.63; 'believe': 0.66; '"yield': 0.84; 'asterisk': 0.84; 'chrisa': 0.84; 'from"': 0.84; 'packing': 0.84; 'subject: *': 0.84; 'walters': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=nLq4W/YlCYDi7dohwxGvkHDv38xtkvwEhNF7sxuDL+I=; b=pyJoHKH6xPAn39ZU58Vw/MNcAivfEA6nyzWowdBjxM2YSrts3oRGQ+THlr6WiWy0NC LSAqLdKGGOBOmANJFzqo6RJA9bMN2OO4TRPfF6ZRPD44XLhKlSNRsG7dSIJ10ZmoQmk3 uNzoWKP4Q2Jh+I5ojiEQyM9nG55TqS/QP/P7RvKOoxPvOTqKbT3pAwGy9EsO/54so37i yDQ/kLJBYyWy9fvzJXvIiObA2wBtG3QhWRRyKRnzDgpe/JSwxpX5ZyjrAlDuvpP3/ybj aR9AvsuhT5LvlxzQ2r2OUQalBdQhDnzsn/hYejxqM/rNQ8Hxu4jBH3FqzcHYSKeaMy5R Yquw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=nLq4W/YlCYDi7dohwxGvkHDv38xtkvwEhNF7sxuDL+I=; b=A/Kmwi7eVN9U05kqscqtDNa9LzWYTztMgOlx7DohSyfRtpVEk5JZXSpeOFN6akCvb5 1alz3aIl1TGj0z473pKAkMvlOryabVx/4mCIjVkWf5QvRBQ7RN+Vu+PJpEaGxnSp0sdZ aB1l3xBsIqdixaNilsP6OvfQW5XtOJ8f9RNIpvzLxjQ2leXKZcKtanWlYFVlV3wQsbUx HOz+uJ+GSp8UK1KmDhmXZcRY+5D5BJCbyGER1jjlk5G+BNulE87jjHn0qe0IxhKRneo+ N3CWiidw3Q/TpSnuc9EH2WI90pBI3E3yVV+U1Mw0nROY96U9VXP2KMP16Cp6eVNkV288 KjPw==
X-Gm-Message-State AOPr4FXJ1vnvonvlY1/vPni68KfDH4csjoszJ1Uo/nF6qi69R8JJxUGHBPxwT2wkroJ1i60J+upkEv4gAF+wkw==
X-Received by 10.50.43.168 with SMTP id x8mr4557338igl.13.1461252406879; Thu, 21 Apr 2016 08:26:46 -0700 (PDT)
In-Reply-To <CAO1D73Fs6_U95TKsmytdH3wgnyUgrZHcaCk5J6xL__xia6U0Ww@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAPTjJmq86WzrEX++hfGRaTfs6XUf+pxF2XdxKKanh58q1AXzGA@mail.gmail.com>
X-Mailman-Original-References <573e61523bfc412ca8674b06d70f2fd7@sraex01sc.sisa.samsung.com> <mailman.36.1461181657.12923.python-list@python.org> <57181d0e$0$1591$c3e8da3$5496439d@news.astraweb.com> <CAO1D73Fs6_U95TKsmytdH3wgnyUgrZHcaCk5J6xL__xia6U0Ww@mail.gmail.com>
Xref csiph.com comp.lang.python:107458

Show key headers only | View raw


On Fri, Apr 22, 2016 at 1:19 AM, justin walters
<walters.justin01@gmail.com> wrote:
> I agree with the others that the new syntax is not needed.
>
> I would also like to point out that I believe any new added syntax or
> functionality should avoid the use of '*' and '**' as both of these
> characters are already used for many things such as optional arguments and
> mathematical operators. Adding more uses for said characters only decreases
> the readability of the code.

The single asterisk is used for packing and unpacking, though. See PEP
448 [1] for some of the ways this can be used (in the context of "the
ways this can NOW be used in Python 3.5"). So the proposed "yield
*sequence" does make good sense; however, "yield from" has, as Steven
pointed out, *far* more detailed semantics, as it basically allows
generators to be refactored, with all their semantics (yield, send,
throw, return).

ChrisA

[1] https://www.python.org/dev/peps/pep-0448/

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


Thread

PEP proposal: sequence expansion support for yield statement: yield * Ken Seehart <k.seehart@partner.samsung.com> - 2016-04-20 19:34 +0000
  Re: PEP proposal: sequence expansion support for yield statement: yield * Steven D'Aprano <steve@pearwood.info> - 2016-04-21 10:21 +1000
    Re: PEP proposal: sequence expansion support for yield statement: yield * justin walters <walters.justin01@gmail.com> - 2016-04-21 08:19 -0700
    Re: PEP proposal: sequence expansion support for yield statement: yield * Chris Angelico <rosuav@gmail.com> - 2016-04-22 01:26 +1000

csiph-web