Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.060 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'syntax': 0.04; 'explicitly': 0.05; 'deny': 0.07; "'return": 0.09; 'sake': 0.09; 'python': 0.11; 'readable': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'properly': 0.19; 'written': 0.21; 'string,': 0.24; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'related': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'comments': 0.31; 'doc': 0.31; 'indentation': 0.31; 'yields': 0.31; 'option': 0.32; 'not.': 0.33; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'yield': 0.36; 'subject:?': 0.36; 'should': 0.36; 'easily': 0.37; 'to:addr:python-list': 0.38; 'rather': 0.38; 'help,': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'ian': 0.60; 'entire': 0.61; 'first': 0.61; 'such': 0.63; 'skip:n 10': 0.64; 'great': 0.65; '30,': 0.65; 'needing': 0.65; 'determine': 0.67; 'enforced': 0.84; 'enforces': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ZeSDwWO9fI15ReY6MXnjLlZH8x690afBvmKpXX6yHjs=; b=gTKL4MSjf+aBuuZdDSOXqT84igJfUcLibISz+kbBv/vmIw2SLGz2hvezM62wPQoMDx 27q97tmyOSo2fAF3QySAfTDdAiK8C4toAO1B8qiEsmKDfQFmBJoDEEzXRZ3ngdRgw/20 LB652CQXES6AgpmcsC/u95mBljjdXNuLvBJDGIGHCnbzq7NDO7Q+Ki3TNltOI8XxiklG 8IQdzDjq8nqKTOXbzVxIaWwoeGEImTxFKrNg7QRdIzDYnuVRUpkQYLCIKt2WM+PSSzNB nc6AWw35PRcFuZbwWSU33+zA08KPRm0knCfdt4fYPyk1dGbmGToaUIMRHyWyZ4uIlvIh fveg== X-Received: by 10.66.164.199 with SMTP id ys7mr18696217pab.104.1372573523759; Sat, 29 Jun 2013 23:25:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <2a2072e3-4b12-4ada-872c-1240d2379928@googlegroups.com> <51cf2b49$0$29999$c3e8da3$5496439d@news.astraweb.com> <2f5e7801-a4cd-4d01-a1e7-7f67bca18199@googlegroups.com> <51cf3695$0$29999$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Sun, 30 Jun 2013 00:24:43 -0600 Subject: Re: Closures in leu of pointers? To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372573534 news.xs4all.nl 15961 [2001:888:2000:d::a6]:39465 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49478 On Sun, Jun 30, 2013 at 12:11 AM, Terry Reedy wrote: > On 6/30/2013 1:46 AM, Ian Kelly wrote: > >> On a related note, I think that generator functions should in some way >> be explicitly marked as such in the declaration, rather than needing >> to scan the entire function body for a yield statement to determine >> whether it's a generator or not. > > > I agree that one should not have to scan. The doc string, which should be > present should start 'Return a generator that yields ...' or even 'Generate > ...'. Of course, then non-generator functions should not start the same way. > The first option should be non-ambiguous. I don't deny that properly written comments help, but consider that Python already enforces proper indentation for the sake of readability. I don't think it would be a great harm if the syntax enforced easily readable generator