Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'correct.': 0.07; 'list?': 0.07; 'builtin': 0.09; 'pages.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'blocks': 0.16; 'downside': 0.16; 'idle.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'remembered': 0.16; 'wrongly': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'header:User-Agent:1': 0.23; 'refers': 0.24; 'decide': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'posting': 0.31; 'changed.': 0.31; 'convenience': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'supposed': 0.32; 'themselves': 0.32; 'another': 0.32; 'text': 0.33; 'not.': 0.33; 'case,': 0.35; 'editor': 0.35; 'there': 0.35; 'idle': 0.36; 'list': 0.37; 'being': 0.38; 'sometimes': 0.38; 'initially': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'color': 0.61; 'received:173': 0.61; 'name': 0.63; 'decided': 0.64; 'worth': 0.66; 'cautious': 0.84; 'clearer': 0.84; 'received:fios.verizon.net': 0.84; 'subject:Don': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Jan Reedy Subject: Re: "Don't rebind built-in names*" - it confuses readers Date: Tue, 11 Jun 2013 02:06:09 -0400 References: <51b691ea$0$29997$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: <51b691ea$0$29997$c3e8da3$5496439d@news.astraweb.com> 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370930788 news.xs4all.nl 15930 [2001:888:2000:d::a6]:42157 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47639 On 6/10/2013 10:56 PM, Steven D'Aprano wrote: >> I was initially confused >> and reading the code still takes a small bit of extra mental energy. >> Idle stays confused and will wrongly color the list instance name until >> it is changed. Calling the file list 'fnames' or 'filenames' would have >> been clearer to both me and Idle. > > Correct. The downside of editors that colourise text is that sometimes > they colourise it wrong. In this case, how is the editor supposed to know > that list no longer refers to the built-in list? > > This is yet another good argument for being cautious about shadowing > built-ins. After posting I remembered that there are also colorized text blocks on web pages. Each person will have to decide for themselves whether the convenience of reusing a builtin name is worth having their code mis-colorized. As a reader, I decided that it is not. tjr