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


Groups > comp.lang.python > #47635

Re: "Don't rebind built-in names*" - it confuses readers

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'nested': 0.07; 'agree,': 0.09; 'received:mail-vc0-f174.google.com': 0.09; 'sure,': 0.09; 'python': 0.11; 'erlang,': 0.16; 'examples?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'merely': 0.16; 'rebound': 0.16; 'scopes': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'variable': 0.18; 'seems': 0.21; 'certainly': 0.24; 'recognize': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'easier': 0.31; "d'aprano": 0.31; 'globally': 0.31; 'received:209.85.220.174': 0.31; 'steven': 0.31; 'figure': 0.32; 'languages': 0.32; 'used,': 0.33; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'opposed': 0.36; 'received:209': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'name': 0.63; 'levels': 0.65; 'apart': 0.72; 'unique.': 0.84; 'defeat': 0.91; 'subject:Don': 0.91; '2013': 0.98
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:to :content-type; bh=UUEivekJnm8md/mHzm9BnK5niCzTygN9bjIxjbb9SQU=; b=sxi2NvEcjHdDafKYl2uZx7S0x6vameL48Wy9qHLj8E3AVCyjPSW10nUBmIG/7AYP1W p32ZTV6X+yLIyarzAxiN0WqiCzxtVRXfqS3MohX0ZZAdpXf91v5rF4fj6Qw/QC2ypGhX U4r7h/O6DATqef0qK8tVEd/HQF4CaB/ffbd+vk5PtuPgg6OMJAAnI++Q0/qrLesndJgb HeNLy2ffB9oevSeiSZTyEQBs7Zci29GNhZFfwFzNsyTuifAjc/8SVUXqN30fr0zH6UtH 2FyNBB1s/+AOLIJ51Tg1+u6mjWvkcaF16e8nwiD0QuZeVYIqSVvlM3xGPJMmeuim4etj IfOQ==
MIME-Version 1.0
X-Received by 10.58.133.81 with SMTP id pa17mr7358793veb.37.1370923024698; Mon, 10 Jun 2013 20:57:04 -0700 (PDT)
In-Reply-To <51b69332$0$29997$c3e8da3$5496439d@news.astraweb.com>
References <mailman.3001.1370909708.3114.python-list@python.org> <dffd70ad-4e9a-45cd-914b-7f1388ded5a2@a9g2000pbq.googlegroups.com> <51b69332$0$29997$c3e8da3$5496439d@news.astraweb.com>
Date Tue, 11 Jun 2013 13:57:04 +1000
Subject Re: "Don't rebind built-in names*" - it confuses readers
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3007.1370923032.3114.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1370923032 news.xs4all.nl 15918 [2001:888:2000:d::a6]:54220
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:47635

Show key headers only | View raw


On Tue, Jun 11, 2013 at 1:02 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Apart from Erlang, got any other examples? Because it seems to me that in
> languages with nested scopes or namespaces, shadowing higher levels is
> exactly the right thing to do. Certainly it would be a PITA, and defeat
> the purpose of having nested scopes, if inner names had to be globally
> unique.

I agree, and it's one of the reasons that I like the explicitness of
C's variable declarations. Sure, Python makes it easier to write code;
but it's easier to figure out what's a global and what's not when
locals are all declared. (Yes, it's not that hard for a human to
recognize when a name is being rebound as opposed to merely used, but
it's extra work for a lexer/syntax highlighter.)

ChrisA

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


Thread

"Don't rebind built-in names*" - it confuses readers Terry Jan Reedy <tjreedy@udel.edu> - 2013-06-10 20:14 -0400
  Re: "Don't rebind built-in names*" - it confuses readers rusi <rustompmody@gmail.com> - 2013-06-10 19:36 -0700
    Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 03:02 +0000
      Re: "Don't rebind built-in names*" - it confuses readers rusi <rustompmody@gmail.com> - 2013-06-10 20:30 -0700
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 05:52 +0000
        Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-11 17:20 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-11 13:57 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Serhiy Storchaka <storchaka@gmail.com> - 2013-06-11 18:55 +0300
      Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 17:04 -0700
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:01 +0000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:08 +1000
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:08 +0000
          Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 11:30 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Skip Montanaro <skip@pobox.com> - 2013-06-12 19:18 -0500
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:33 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Ethan Furman <ethan@stoneleaf.us> - 2013-06-12 17:30 -0700
  Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 02:56 +0000
    Re: "Don't rebind built-in names*" - it confuses readers Terry Jan Reedy <tjreedy@udel.edu> - 2013-06-11 02:06 -0400
    Re: "Don't rebind built-in names*" - it confuses readers Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 08:22 -0700
      Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 16:59 +0000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-12 03:32 +1000

csiph-web