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: 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: <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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Tue, Jun 11, 2013 at 1:02 PM, Steven D'Aprano 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