Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!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.043 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:Python': 0.05; 'compiler': 0.05; 'high-level': 0.09; 'okay': 0.09; 'thu,': 0.15; 'all):': 0.16; '{0}': 0.16; 'wrote:': 0.16; 'variable': 0.18; '2015': 0.20; 'meant': 0.22; 'sep': 0.22; 'this:': 0.23; 'header :In-Reply-To:1': 0.24; "doesn't": 0.26; 'possibility': 0.27; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'occasional': 0.29; 'optional.': 0.29; 'creating': 0.30; "i'd": 0.31; 'probably': 0.31; 'point': 0.33; 'clarify': 0.33; 'open': 0.33; 'received:google.com': 0.35; 'level': 0.35; 'but': 0.36; 'should': 0.36; 'possible': 0.36; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'wanted': 0.37; 'to:addr:python.org': 0.40; 'where': 0.40; 'still': 0.40; 'high': 0.60; 'hope': 0.61; 'skip:u 10': 0.61; 'making': 0.62; 'function():': 0.84; 'local,': 0.84; 'to:name:python': 0.84; '1:47': 0.91; 'technically': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=8ruygW0SHpRhNUkZpcOTck25c9wjJhnWG6kl5lXwbDk=; b=J7BFznwbpWudKd45+VqWn1FGKW3a53+BxboCLNpM74TanxiGpPJpLx2vGTAW0isJhO HYDjs6DqLwCosvavUzSOfzktDOjrXZi4wycFtIs87yWu9/PGrB4AjcOzljoNPE0Nbf1n r3sZRLfUStTgGbVXPezmeJVGQ+27w03FbY7IGKaVNKz+J+zHlIhDN+aDVC67nUPg4fr3 PWFcA6No8LdhEFT/1q05wr1Qje40kcZOtMILPhmp6GWzIyCHJCNRzDNq5eCaP48TxxM0 vLVayJ/6lT0iQvU5QTuqzfU4N7ux1RkOw/hVhmJgIMvsjMg8vtzMb1Vi7T6ToHyDUAER Z9Zw== X-Received: by 10.129.31.135 with SMTP id f129mr42757233ywf.85.1441309955527; Thu, 03 Sep 2015 12:52:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4602a32c-5109-47dd-95bb-b9723738f07f@googlegroups.com> From: Ian Kelly Date: Thu, 3 Sep 2015 13:51:56 -0600 Subject: Re: Python handles globals badly. To: Python Content-Type: text/plain; charset=UTF-8 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441309964 news.xs4all.nl 23832 [2001:888:2000:d::a6]:43597 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95970 On Thu, Sep 3, 2015 at 1:47 PM, Ian Kelly wrote: > On Thu, Sep 3, 2015 at 1:05 PM, wrote: > >> But then I ask you from high-level point of view >> (if my high level view is correct at all): >> Would you remove this keyword if it would be technically possible >> or is good for you from high level point of view to have a keyword "global"? > > Provided that the proposal doesn't open up the possibility of > unintentionally creating a global variable where I wanted a local, I'd > be okay with it. Let me clarify that I'd be okay with making the keyword optional. It should probably still be kept around for the occasional use like this: exec("""def function(): global {0} {0} = 42 """.format('x')) where the compiler would have little hope of figuring out that the variable was meant to be global without it.