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


Groups > comp.lang.python > #39969

Re: yield expression

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.057
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'value.': 0.15; 'count)': 0.16; 'expression.': 0.16; 'statement.': 0.16; 'subject:expression': 0.16; 'subject:yield': 0.16; 'wrote:': 0.17; 'odd': 0.17; 'yield': 0.17; 'feb': 0.19; 'bit': 0.21; 'statement': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'statements': 0.29; 'url:python': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'url:org': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; '26,': 0.65; '2013': 0.84; 'compare:': 0.84; 'to:name:python': 0.84; 'url:reference': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=fa8V8BP2YGhgUyD019CRvDTqiMY2LFm0YIwVDEfjK/k=; b=U9gwZHK6U4XlV8Fe9FSfFY9RP9smRgcB3rbcTr4UWkuOQf/J7QvMIFQr54Zv/1QpXm YUjEnXtphcOKwPccduyEba3atXBITgCj7rSiEwkRCjg+q0otKxMpnM1yUL8q02v8jruD PSeFIkD59qIJzb1vIgL98/W60apbW4AVtnDdZH3UQT3jCvhYELM9y7FmGfiE8sYxda31 DP6PtUfftsblsnptDCOXwXOkEfzv66tOpJXWvWevicOCSfZVqerPlxilKIw72oDE5AQa iyEPwxQsGXY3r+Ug4s3+3bD97huxjD9ea1vxJPKJTTuAmespAZD2GV6oTjSP0vOliZc6 bzpg==
X-Received by 10.58.196.170 with SMTP id in10mr680159vec.37.1361897459975; Tue, 26 Feb 2013 08:50:59 -0800 (PST)
MIME-Version 1.0
In-Reply-To <kgio69$5i7$1@theodyn.ncf.ca>
References <d7760f61-08dd-4186-8844-5f8415773a49@googlegroups.com> <kgio69$5i7$1@theodyn.ncf.ca>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 26 Feb 2013 09:50:19 -0700
Subject Re: yield expression
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2551.1361897462.2939.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1361897462 news.xs4all.nl 6885 [2001:888:2000:d::a6]:46211
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:39969

Show key headers only | View raw


On Tue, Feb 26, 2013 at 9:34 AM, Colin J. Williams <cjw@ncf.ca> wrote:
> Perhaps it's becaoue (teild count) is a statement.  Statements do not return
> a value.

yield is a bit of an odd duck in that it's both a statement and an
expression.  Compare:

http://docs.python.org/3/reference/simple_stmts.html#the-yield-statement

http://docs.python.org/3/reference/expressions.html#yieldexpr

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


Thread

yield expression Ziliang Chen <zlchen.ken@gmail.com> - 2013-02-24 16:36 -0800
  Re: yield expression "Colin J. Williams" <cjw@ncf.ca> - 2013-02-26 11:34 -0500
    Re: yield expression Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-26 09:50 -0700
    Re: yield expression Dave Angel <davea@davea.name> - 2013-02-26 12:05 -0500
    Re: yield expression "Vytas D." <vytasd2013@gmail.com> - 2013-02-26 17:07 +0000
      Re: yield expression "Colin J. Williams" <cjw@ncf.ca> - 2013-02-26 13:44 -0500
        Re: yield expression Dave Angel <davea@davea.name> - 2013-02-26 21:59 -0500
      Re: yield expression "Colin J. Williams" <cjw@ncf.ca> - 2013-02-26 13:44 -0500

csiph-web