Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'function,': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; 'effect.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:2.7': 0.09; 'function?': 0.16; 'parks': 0.16; 'reedy': 0.16; 'scope,': 0.16; 'scope.': 0.16; 'travis': 0.16; 'wrote:': 0.16; 'defined': 0.19; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'sep': 0.23; 'pm,': 0.24; 'statement': 0.25; 'module.': 0.29; 'yes.': 0.30; 'despite': 0.32; 'does': 0.32; 'to:addr:python- list': 0.33; 'rules': 0.34; 'header:User-Agent:1': 0.34; 'header:X -Complaints-To:1': 0.35; 'received:org': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'order': 0.62; 'introduce': 0.79; '12:53': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Handling 2.7 and 3.0 Versions of Dict Date: Fri, 02 Sep 2011 16:22:35 -0400 References: <50924476-9ada-487e-bd4b-5b77bce11d5b@gz5g2000vbb.googlegroups.com> <4E5E051B.8060002@v.loewis.de> <9c7utuF8q8U1@mid.individual.net> <93c5378e-03f8-4764-96e8-2c3e8568baec@z8g2000yqe.googlegroups.com> <42b6b7cb-d659-4921-bec9-6a43671848e2@s20g2000yql.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: <42b6b7cb-d659-4921-bec9-6a43671848e2@s20g2000yql.googlegroups.com> 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1314995014 news.xs4all.nl 2550 [2001:888:2000:d::a6]:42570 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12672 On 9/2/2011 12:53 PM, Travis Parks wrote: > On Sep 2, 12:36 pm, "Gabriel Genellina" >> Those if/else are at global scope. An 'if' statement does not introduce a >> new scope; so getDictValues, despite being "indented", is defined at >> global scope, and may be used anywhere in the module. > Does that mean the rules would be different inside a function? Yes. Inside a function, you would have to add global getDictValues before the if statement in order for the assignments to have global effect. -- Terry Jan Reedy