Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed5.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:when': 0.07; 'unexpected': 0.07; 'be:': 0.09; 'am,': 0.12; 'things.': 0.13; 'library': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'library?': 0.16; 'plethora': 0.16; 'subject:builtin': 0.16; 'yes;': 0.16; "\xa0it's": 0.16; 'syntax': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'language': 0.17; 'header:In- Reply-To:1': 0.22; 'aug': 0.24; 'function': 0.27; 'language.': 0.28; 'message-id:@mail.gmail.com': 0.29; '(and': 0.29; "won't": 0.29; 'module': 0.30; 'subject:?': 0.31; 'does': 0.32; "can't": 0.33; 'to:addr:python-list': 0.33; '17,': 0.34; 'unless': 0.36; 'anything': 0.36; 'issue': 0.36; 'steven': 0.38; 'some': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'thoughts': 0.39; 'define': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'discover': 0.67; 'day': 0.69; 'received:209.85.218.46': 0.91; 'received:mail- yi0-f46.google.com': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=H26MkgJZWCGACLouvfry47MNhaO+GS+B/nrWA5r8vbY=; b=cDyiFSVMTsK8vslNJGsJ3tnqYqa5vrn+Utkag8+32KrSeA7wtLASuNwV7DBOJmm8e+ u/2sGlXxoMfX3fDwecFCznKcyiElG+mm2kw3ErMUv+61r/fgnxqkABxOseXjZ08qr+Bi w2mCLggMcY7ZF9Gql3P+JXcLNpnzNvcxjACaE= MIME-Version: 1.0 In-Reply-To: <4e4b1242$0$29966$c3e8da3$5496439d@news.astraweb.com> References: <4e49c89a$0$30001$c3e8da3$5496439d@news.astraweb.com> <4e49fcd7$0$29974$c3e8da3$5496439d@news.astraweb.com> <4e4b1242$0$29966$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 17 Aug 2011 08:34:22 +0100 Subject: Re: Why no warnings when re-assigning builtin names? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313566464 news.xs4all.nl 23840 [2001:888:2000:d::a6]:45081 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11663 On Wed, Aug 17, 2011 at 1:58 AM, Steven D'Aprano wrote: >> My thoughts would be: >> 1. =A0It's hard to avoid shadowing anything unless you know the entire >> language and never forget things. > > Define the "entire language". Does that include the names of all the > plethora of exceptions? How about the standard library? The shadowing issue applies to the standard library as well as the builtins, so yes; to avoid shadowing *anything*, you would have to know the entire language. I posit that this is a practical impossibility, and that unexpected shadowing will always be possible (and won't always be prevented by syntax highlighting). Some day you'll discover that you can't use module X because you have a function called X, and you'll have to rename. ChrisA