Path: csiph.com!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 02:17:28 +0000 (UTC) Lines: 23 Message-ID: References: <573EC62F.4090401@lucidity.plus.com> <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> X-Trace: news.uni-berlin.de dirISMpjvsAA74u4vvvD/wZMa6XdjrxhuLmix9/NWAzA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'brett': 0.09; 'python:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'recommends': 0.09; 'subject:while': 0.09; "hasn't": 0.15; '2016': 0.16; 'loops': 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; 'wrote:': 0.16; 'numerical': 0.18; "shouldn't": 0.18; '(see': 0.20; 'python"': 0.22; 'am,': 0.23; 'sat,': 0.23; "i've": 0.25; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; 'point.': 0.27; 'received:24': 0.28; 'behaviour': 0.29; 'probably': 0.31; 'anybody': 0.32; 'class': 0.33; "d'aprano": 0.33; 'received:comcast.net': 0.33; 'steven': 0.33; "isn't": 0.35; 'item': 0.35; 'according': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'to:addr:python.org': 0.40; 'behavior': 0.61; 'avoid': 0.61; 'subject: / ': 0.63; 'subject:else': 0.84; 'subject:sense': 0.84 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> Xref: csiph.com comp.lang.python:108884 On 2016-05-20, Steven D'Aprano wrote: > On Sat, 21 May 2016 05:20 am, Christopher Reimer wrote: > >> According to "Effective Python: 59 Specific Ways to Write Better Python" >> by Brett Slatkin, Item 12 recommends against using the else block after >> for and while loops (see page 25): "Avoid using else blocks after loops >> because their behavior isn't intuitive and can be confusing." > > By that logic, we ought to: > > - avoid using floats because their behaviour isn't intuitive and > can be confusing; Well, a lot of people probably should avoid floats. I've often said that anybody who hasn't taken a numerical methods class shouldn't be allowed to use floating point. -- Grant