Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'root': 0.04; 'subject:Python': 0.05; 'globals': 0.09; 'imho.': 0.09; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'programmers,': 0.16; 'received:192.168.1.4': 0.16; 'reflects': 0.16; 'similarly,': 0.16; 'var.': 0.16; 'wrote:': 0.16; 'saying': 0.22; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; 'var': 0.27; 'function': 0.28; '"the': 0.32; 'point': 0.33; 'keyword': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'agree': 0.37; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'money': 0.71; 'scientists,': 0.72; 'forth': 0.79; '"money': 0.84; 'collective': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=CvRCCSMD c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=IkcTkHD0fZMA:10 a=x7NFwFdeZkdPlIRSTGMA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett@:2500 Subject: Re: Python handles globals badly. To: python-list@python.org References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55E75731.9000609@mail.de> From: MRAB Date: Wed, 2 Sep 2015 21:22:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E75731.9000609@mail.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441225331 news.xs4all.nl 23791 [2001:888:2000:d::a6]:48300 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3621 X-Received-Body-CRC: 2820650143 Xref: csiph.com comp.lang.python:95895 On 2015-09-02 21:08, Sven R. Kunze wrote: > On 02.09.2015 20:47, tdev@freenet.de wrote: >> I agree with Skybuck Flying. >> I am aware if a var is a module function var or a module global var. >> If I want read or write a global var. >> >> Using the keyword global inside each(!) function only >> to mark the global var writeable in each of the functions >> is really an over-regulation and very annoying from my point of view. > > It reflects the collective experience of programmers, computer > scientists, and so forth of the last decades. > > > Globals are evil. Stay away from them. > I think it's like that sometimes-misquoted saying "money is the root of all evil". It's "the love of money is the root of all evil". Similarly, it's the love (or misuse or overuse) of globals that's evil, IMHO.