Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: for / while else doesn't make sense Date: Sat, 21 May 2016 15:20:17 +0000 (UTC) Lines: 32 Message-ID: References: <573EC62F.4090401@lucidity.plus.com> <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> <87d1og3q33.fsf@elektro.pacujo.net> <574045e1$0$22142$c3e8da3$5496439d@news.astraweb.com> X-Trace: news.uni-berlin.de +/ATqgE/OCL5ofSu+NoHvwQ+bHPPZ3Aj8+DSmAdpvWuQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'true,': 0.04; '21,': 0.07; 'clause': 0.07; 'hettinger': 0.07; 'backwards': 0.09; 'prejudice': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'semantics': 0.09; 'subject:while': 0.09; 'thread': 0.10; 'python': 0.10; 'assume': 0.11; '"this': 0.13; '2016': 0.16; 'argument.': 0.16; 'feature?': 0.16; 'innovate': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:make': 0.16; 'which,': 0.16; 'wished': 0.16; 'wrote:': 0.16; 'language': 0.19; 'am,': 0.23; 'sat,': 0.23; "haven't": 0.24; "i've": 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'sense': 0.26; 'wonder': 0.27; 'question': 0.27; 'received:24': 0.28; 'feature,': 0.29; '(including': 0.30; 'raymond': 0.30; 'anyone': 0.32; "can't": 0.32; "d'aprano": 0.33; 'received:comcast.net': 0.33; 'steven': 0.33; 'changing': 0.34; 'languages': 0.34; 'besides': 0.35; 'sometimes': 0.35; 'according': 0.36; 'url:org': 0.36; 'alone': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'starting': 0.37; 'does': 0.39; 'enough': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'easy': 0.60; 'close': 0.61; 'is.': 0.63; 'subject: / ': 0.63; 'times': 0.63; 'rare': 0.66; 'attention': 0.76; 'compelling': 0.84; 'donald': 0.84; 'subject:else': 0.84; 'subject:sense': 0.84; 'video:': 0.84; 'url:video': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: c-24-118-110-103.hsd1.mn.comcast.net User-Agent: slrn/1.0.2 (Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <573EC62F.4090401@lucidity.plus.com> <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> <87d1og3q33.fsf@elektro.pacujo.net> <574045e1$0$22142$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:108919 On 2016-05-21, Ian Kelly wrote: > On Sat, May 21, 2016 at 5:26 AM, Steven D'Aprano wrote: > >> Does anyone know of other languages that include the same feature? >> It's very rare for Python to innovate in language features. >> >> (I wonder if it came from ABC?) > > According to Raymond Hettinger starting at about 15:50 in this > video: > > http://pyvideo.org/video/1780/transforming-code-into-beautiful-idiomatic-pytho > > It was invented by Donald Knuth (including the choice of keyword). If true, that alone dismisses with prejudice any question of changing it. As if backwards compatibility weren't a compelling enough argument. Besides which, I happen to think it makes sense the way it is. [I haven't been paying very close attention to this thread for a while, so I assume that "this feature" and "it" still refer to having an else clause in for/while loops?] I can't count the number of times I've wished C had such a feature, and have sometimes resorted to using a "goto" to get the same semantics in an easy to read/understand way. -- Grant