Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'indicating': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'things.': 0.15; '"global"': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'variable': 0.18; 'explicit': 0.22; 'am,': 0.23; 'code.': 0.23; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'function': 0.28; 'pep': 0.29; 'allows': 0.30; 'class': 0.33; 'add': 0.34; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'setting': 0.37; 'received:org': 0.37; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'more': 0.63; 'therefore': 0.67; 'feeling': 0.72; 'received:12': 0.81 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Emile van Sebille Subject: Re: Python handles globals badly. Date: Wed, 2 Sep 2015 12:34:23 -0700 References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: www.westernstatesglass.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441222481 news.xs4all.nl 23733 [2001:888:2000:d::a6]:55847 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95890 On 9/2/2015 11:47 AM, tdev@freenet.de wrote: > I therefore would like to see a PEP which allows also writing > global module vars inside module functions without the need > for explicit setting the keyword "global" in more or less each(!) > module function as the first line of code. If you're feeling like you need to add global statements to a lot of functions to enable variable sharing/access, it may be codesmell indicating it's time to make a class of things. Emile