Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed10.multikabel.net!xlned.com!feeder5.xlned.com!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '"if': 0.04; 'default.': 0.09; 'global,': 0.09; 'programmer': 0.10; 'tries': 0.15; 'cc:addr:benfinney.id.au': 0.16; 'cc:name:ben finney': 0.16; 'presence.': 0.16; 'scope.': 0.16; 'subject:Overriding': 0.16; 'subject:global': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'cc:no real name:2**0': 0.20; 'header:In-Reply- To:1': 0.22; 'function': 0.27; 'asking': 0.28; 'variable': 0.28; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'environment': 0.30; 'yes.': 0.30; 'wanting': 0.32; 'header:User-Agent:1': 0.33; 'actually': 0.33; 'too': 0.34; 'presence': 0.36; 'cc:2**1': 0.36; 'received:192': 0.37; 'think': 0.37; 'could': 0.37; "it's": 0.40; 'received:192.168': 0.40; 'act': 0.65; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'different.': 0.84; 'reasoning': 0.84 Date: Mon, 12 Dec 2011 20:46:14 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: Joshua Landau Subject: Re: Overriding a global References: <4ee671f6$0$29979$c3e8da3$5496439d@news.astraweb.com> <87k4611l4y.fsf@benfinney.id.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:rKOhW3DWdefpzHdeTuuZjCxyntJ3GCK1fASIn5VF3x8 fz5H48MvZPeC4kb0TSd1dx9qJXdzcgizSxiaciqoXipoc54BOi Skbr9KJOHwSn4whxP/EvOBY3DzdYUTL/gsxHomA4f+y6fOwo7j 2evUUNJgT6KgPq/43fv+phF3h3B7EXeQOf+NIYuRbOO1mfVgBb 4cKGJXTaU91x0wPpl9ki8kKkfwDRkVg9dJQV+fFSazY+uwFYPH /UxgozZlCiytj/35DBPTYGirn93iruvQ/CuO1hXPpHoSiDSmMa C37YVB5iHLgv+jMWgH8TFoVc+Kx2sJpvVeCWjpaeglBmSC5nwU e0rqsVGotoZmIliZw/wA= Cc: python-list@python.org, Ben Finney X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323740790 news.xs4all.nl 6974 [2001:888:2000:d::a6]:47916 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17100 On 12/12/2011 06:48 PM, Joshua Landau wrote: >>> If a function knows of the presence of a global, it's not asking too >>> much for it to not re-use the same name in local scope. >> Yes. > > It's just a function wanting to act as-if it were in a different > environment than its default. By that same reasoning you could state that > "If a function knows of the presence of a built-in, it's not asking > too much for it to not re-use the same name in local scope." > It's entirely different. It's only the same if the function actually tries to call the built-in, then also wants a local variable with a different purpose. Think a little about what I mean that the function "knows of the presence." I did not say the programmer knows of the presence. -- DaveA