Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'value,': 0.04; 'subject:Python': 0.06; '21,': 0.07; '"if': 0.09; 'trailing': 0.09; 'cc:addr:python-list': 0.11; "wouldn't": 0.14; '"value"': 0.16; "'if',": 0.16; 'else"': 0.16; 'elsewhere,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'subject:library': 0.16; 'underscore.': 0.16; 'so.': 0.16; 'wrote:': 0.18; 'command': 0.22; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'parse': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'on,': 0.29; 'raise': 0.29; 'words': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'that.': 0.31; '(although': 0.31; 'context.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'allows': 0.31; 'fri,': 0.33; 'subject:the': 0.34; 'possible.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'in:': 0.36; 'var': 0.36; 'useful': 0.36; 'pm,': 0.38; 'that,': 0.38; 'most': 0.60; 'more': 0.64; 'hostile': 0.84; 'to:none': 0.92; 'hand,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=JHADgtWGtdD7+4YLwmdwxeMNYGEKdcUh3M9I4tmm94Q=; b=ohx1HykNYuGGUIKS/DGhX+LMmAM6BblJZxb86Xm0WSvOsZvsvBdWsdthLcyAhO2YgU AmEUxJG9fwj0xl8D9zj5DKwLAsWboeIVPe3JeWEK91h3NgF2AGdnO3CNMN3MIRjWTd+u 8pnxBGownTe9ljdY7kg2g8EB2BVD6r3Xkrq+TFBYSWYPTxaxRxSYILQHiik7jaWDfNJb v3k9Ghvdwd8B4YmWE6D69KRaverEh83kagg034POXHt9iQnIE6DDRl1deN3LgZRO4cFA pVychGx1C7GI+RcjlfU4AyKPNZ56m3N9f+OR9gTyzUVUUhd0L9Lvh2ZWHhb4G9/ONtUQ i55A== MIME-Version: 1.0 X-Received: by 10.68.112.164 with SMTP id ir4mr7171825pbb.153.1392966620959; Thu, 20 Feb 2014 23:10:20 -0800 (PST) In-Reply-To: <5306f95d$0$29985$c3e8da3$5496439d@news.astraweb.com> References: <87mwhm6q3e.fsf@elektro.pacujo.net> <5306f95d$0$29985$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 21 Feb 2014 18:10:20 +1100 Subject: Re: Commonly-used names in the Python standard library From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392966624 news.xs4all.nl 2940 [2001:888:2000:d::a6]:46682 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66803 On Fri, Feb 21, 2014 at 5:59 PM, Steven D'Aprano wrote: > Then I can write code like: > > for for in in: > while while: > if if: > raise raise > > which will go a long way to ensuring that my code is an hostile and > unreadable as possible. REXX allows that. Most people wouldn't use classic keywords like 'if', as that'll only cause confusion (although "if if then then; else else" is legal), but some of the other keywords are useful in other contexts. The main advantage is that, for instance, the PARSE command can freely use keywords: PARSE VAR x blah blah PARSE VALUE linein(blah) WITH blah blah All those words (parse, var, value, with) are keywords - in that context. But I can happily use "var" and "value" elsewhere, and will do so. Python, on the other hand, has to be more careful; so you see things like "cls" instead of "class", or "import_" and so on, with the trailing underscore. Trade-offs. ChrisA