Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'true,': 0.05; 'debug': 0.07; 'none,': 0.07; 'false,': 0.09; 'feature,': 0.09; 'handful': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'summary.': 0.09; 'python': 0.11; 'jan': 0.12; 'useful,': 0.14; '(it': 0.16; 'bug,': 0.16; 'list)': 0.16; 'none).': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'str,': 0.16; 'followed': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; "shouldn't": 0.24; 'developers': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'usually': 0.31; 'accidentally': 0.31; "d'aprano": 0.31; 'exceptions': 0.31; 'int,': 0.31; 'steven': 0.31; 'allows': 0.31; '(e.g.': 0.33; 'cases': 0.33; 'core': 0.34; "can't": 0.35; 'good.': 0.35; 'but': 0.35; 'there': 0.35; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'easy': 0.60; 'providing': 0.61; 'sum': 0.64; 'here': 0.66; 'harm.': 0.84; 'is)': 0.84; 'received:fios.verizon.net': 0.84; 'shadow': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: anomaly Date: Tue, 12 May 2015 16:23:42 -0400 References: <554F9525.5040101@digipen.edu> <5550815E.5080600@rece.vub.ac.be> <5550a1d4$0$13013$c3e8da3$5496439d@news.astraweb.com> <5550B0CF.208@rece.vub.ac.be> <55520685$0$12984$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <55520685$0$12984$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 1431462248 news.xs4all.nl 2938 [2001:888:2000:d::a6]:46740 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90492 On 5/12/2015 9:56 AM, Steven D'Aprano wrote: > The consensus among the core developers is: > > * in general, the harm and inconvenience from accidentally > shadowing built-ins is not great, and it usually easy to > spot, debug and prevent; > > * when it comes to built-in functions (e.g. sum, map, pow) > and types (e.g. int, str, list) there are significant and > important use-cases for allowing shadowing; > > (e.g. the built-in sum function shouldn't prevent other > modules from providing their own sum function) > > * but when it comes to None, True and False, there are no > significant or important use-cases for shadowing (it is > almost always a bug, not a feature, to redefine None). > > The general principle here is of consenting adults: Python allows you to > shadow built-ins because sometimes it is useful, and the good outweighs the > potential harm. There are a handful of exceptions to that general principle > (e.g. None, True, False, I can't think of any others) because in those > cases the harm (as tiny as it is) outweighs the good. Having followed Python development for 18 years, I think this is a fair summary. -- Terry Jan Reedy