Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Reimer Newsgroups: comp.lang.python Subject: Re: for / while else doesn't make sense Date: Fri, 20 May 2016 18:23:57 -0700 Lines: 24 Message-ID: References: <573EC62F.4090401@lucidity.plus.com> <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> <44ec67e8-0c6e-54d9-c2fc-a4d9b78efb3d@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de bz+V2L1fEEWB86zN0FLP1AxqQloz61BFVwuxT2gSqW8w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'feature.': 0.07; 'javascript,': 0.07; 'derived': 0.09; 'integer,': 0.09; 'ruby,': 0.09; 'statements': 0.09; 'subject:while': 0.09; 'bug': 0.10; 'python': 0.10; 'python.': 0.11; 'language,': 0.11; 'syntax': 0.13; 'received:io': 0.16; 'received:psf.io': 0.16; 'rewritten': 0.16; 'subject:make': 0.16; 'wrote:': 0.16; 'string,': 0.18; 'language': 0.19; 'programming': 0.22; 'feature': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'chris': 0.26; 'figure': 0.27; 'received:17': 0.27; 'idea': 0.28; 'looks': 0.29; 'for,': 0.29; 'wasting': 0.29; 'code': 0.30; '(i.e.,': 0.30; 'another': 0.32; 'received:10.0.0': 0.32; 'language.': 0.32; 'point': 0.33; 'common': 0.33; "d'aprano": 0.33; 'picking': 0.33; 'steven': 0.33; 'surely': 0.33; 'languages': 0.34; 'received:10.0': 0.34; 'but': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thought': 0.37; 'thank': 0.38; 'end': 0.39; 'does': 0.39; 'easily': 0.39; 'to:addr:python.org': 0.40; 'header:MIME-version:1': 0.60; 'your': 0.60; 'share': 0.61; 'avoid': 0.61; 'charset:windows-1252': 0.62; 'subject: / ': 0.63; 'different': 0.63; 'specializing': 0.76; 'float,': 0.84; 'header :In-reply-to:1': 0.84; 'perspective,': 0.84; 'subject:else': 0.84; 'subject:sense': 0.84 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-20_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605210014 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 In-reply-to: <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1463793835; bh=/RTL/AoQF53NdVnL9lvKBf2deDNSxHhrfwgz/RWyoPw=; h=Subject:To:From:Message-id:Date:MIME-version:Content-type; b=o9JRX/eYGFGVXGz0NGzQWXaWKc9NDSP2gCg2MIHv+aUI7ba+90H30/yBGocqhATr3 z+F+07asRRds8x+IBehPZmQHwWtOUHu2qAt2PXCRNq9B6c4b6F32Pml6rtI1euRm3W PS21g5SBgwADnI6eefTDd1JqtAjaSR18r1pfXRnRxZp24Y9F+j4WDX9Px/zPhmYgWM bECOy6GWwYe0gR9kNLta8MvORI4loXdFkB8wc5v1dlCnn9WcOGF5rcmJnHTkYTNOA5 +VImfhn+KPEyM9qpN380FbRT2y9/d4DnfYTlUGqBWIyHrj+OJFSV1zYgMgQvSX1C4T fcfIBGtkQHuDA== 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: <44ec67e8-0c6e-54d9-c2fc-a4d9b78efb3d@icloud.com> X-Mailman-Original-References: <573EC62F.4090401@lucidity.plus.com> <573f9322$0$1616$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:108885 On 5/20/2016 3:43 PM, Steven D'Aprano wrote: > But the idea that you should avoid a Python feature while programming in > Python because Javascript doesn't have it, or Ruby, or C, is surely the > height of muddleheaded thinking. You're not programming Javascript, Ruby or > C, you're programming in Python. The whole point of picking one language > over another is to get access to the tools and features that language > offers. Otherwise you're just wasting your time. For many years I have resisted specializing in a programming language, as I can easily write any program in pseudo code and figure out the syntax for a particular language. Now it does help that most languages have derived from C and share a common feature set (i.e., string, integer, float, if/else, while, for, etc.). From my perspective, tacking on an else block to the end of a for or while loop looks like a bug or a not very well thought out feature. If I was translating a Python program with for/else or while/else statements into a different language, those statements will have to be rewritten anyway. Thank you, Chris R.