Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.kpn.net!pfeed08.wxs.nl!newsfeed.xs4all.nl!newsfeed6.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; '(using': 0.05; 'builtins': 0.07; 'practice,': 0.07; 'subject:when': 0.07; 'builtin': 0.09; "person's": 0.09; 'programmer': 0.10; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'message- id:@tim.thechases.com': 0.16; 'patching': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'scopes': 0.16; 'subject:builtin': 0.16; 'cc:addr:python-list': 0.16; 'possibly': 0.16; 'wrote:': 0.16; 'meant': 0.17; 'otherwise,': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.22; 'header:In-Reply-To:1': 0.22; '(usually': 0.23; 'module,': 0.23; 'pm,': 0.24; "i'm": 0.27; 'fact': 0.27; "wasn't": 0.28; 'import': 0.28; 'cc:addr:python.org': 0.30; 'module': 0.30; 'feature,': 0.30; 'subject:?': 0.31; "didn't": 0.31; 'list': 0.32; 'about.': 0.32; 'it.': 0.33; 'there': 0.33; "i've": 0.34; 'header:User- Agent:1': 0.34; 'things': 0.34; 'pretty': 0.35; 'unless': 0.36; 'doing': 0.36; 'another': 0.37; 'something': 0.37; 'authors': 0.38; 'subject:: ': 0.39; 'under': 0.39; "i'd": 0.40; 'hit': 0.40; 'might': 0.40; 'where': 0.40; 'more': 0.60; 'care': 0.71; 'circumstance': 0.84; 'ignorant': 0.84; 'problems?': 0.84; 'dozens': 0.91 Date: Tue, 16 Aug 2011 13:34:53 -0500 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Seebs Subject: Re: Why no warnings when re-assigning builtin names? References: <4e49c89a$0$30001$c3e8da3$5496439d@news.astraweb.com> <4e49fcd7$0$29974$c3e8da3$5496439d@news.astraweb.com> <2A3EB048-1F10-46E8-973F-9BBD303E7B9F@semanchuk.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Source: X-Source-Args: X-Source-Dir: Cc: python-list@python.org 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313519705 news.xs4all.nl 23886 [2001:888:2000:d::a6]:42792 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11595 On 08/16/2011 12:11 PM, Seebs wrote: > Under which circumstance will you have more problems? > > 1. There is not a single shadowed built-in in the entire project. > 2. There are dozens of shadowed built-ins based on when the original > programmer felt there wasn't going to be a need for a given built-in > feature, or possibly just didn't know about it. In practice, I've never hit such a snag. For #2, the only way it would impact me is if I did the ill-advised from shadowy import * which might tromp on things I care about. Otherwise, I'd just do something like from shadowy import list as shadowy_list, id as shadowy_id If I'm altering another person's ill-created module, I might consider doing a search for builtins and then just simply patching the module so that it renamed all the shadowing usages. Unless the author was being particularly obscure (using scope to impact where a builtin meant the builtin, and other scopes to shadow the builtins), most authors are pretty consistent in their shadowing (usually ignorant of the fact they're shadowing the builtin) which makes the search-n-replace an easy tweak. -tkc