Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66803

Re: Commonly-used names in the Python standard library

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 <rosuav@gmail.com>
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 <mailman.7178.1392889158.18130.python-list@python.org> <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 <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7212.1392966624.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Fri, Feb 21, 2014 at 5:59 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 20:39 +1100
  Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 12:22 +0200
    Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 21:43 +1100
      Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 13:28 +0200
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 22:37 +1100
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 22:47 +1100
          Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 14:09 +0200
            Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 23:19 +1100
              Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 14:46 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 00:34 +1100
                Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 17:14 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 02:48 +1100
                Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 18:26 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 03:36 +1100
                Re: Commonly-used names in the Python standard library 88888 Dihedral <dihedral88888@gmail.com> - 2014-02-21 12:57 -0800
                Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:49 +0000
            Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:43 +0000
    Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:59 +0000
      Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 18:10 +1100
      Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 09:21 +0200
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 19:21 +1100
          Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 12:26 +0200
            Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 21:49 +1100
              Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 14:03 +0200
                Re: Commonly-used names in the Python standard library Ethan Furman <ethan@stoneleaf.us> - 2014-02-21 11:16 -0800
        Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 09:12 +0000
  Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:51 +0000
    Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 18:02 +1100

csiph-web