Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'modify': 0.04; 'cc:addr :python-list': 0.09; 'subject:How': 0.09; 'globals': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ivan': 0.16; 'subject:variable': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'received:google.com': 0.35; 'should': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'subject:the': 0.39; '30,': 0.63; 'chrisa': 0.84; 'subject:value': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gxKfCEwPRwNb2A2mn1YslLpSWnUt0uf8ksz/EHws1lg=; b=IbyPPlqfK0WgDg+w9ae3iM4M0UrpmbRpkFLVlaPEcVGodWiyJW0MalImaCDsN8YrUs YKVQajFPX4ImTdTzvhk7tg27kkCIV94ZnRApgS05u/jj0KYhtMlcF8swb4UEpQYbowS8 6mf5k+qDmYhqK/2jWUBjTRyfkD5/AMRh9WRKqU52fVnyFPP2fpSwKvGtN2EcYO6Bcu3D FwtmYh/C3lyJU/wdW/kaTyCIcyJ+2got8+sPoZMrqlhhJGU0z3IroUOKnfYWo4BuBB1G T789bbFPNl/O+QwZ+IrZHRZ4LbZR27sZoBvgPivEiP+YImjZnd89lyCakN0QgSJ7AiRk OjPw== MIME-Version: 1.0 X-Received: by 10.107.41.142 with SMTP id p136mr5608204iop.19.1440865208022; Sat, 29 Aug 2015 09:20:08 -0700 (PDT) In-Reply-To: <000d01d0e276$47a02400$d6e06c00$@gmail.com> References: <002e01d0e0f5$d17b4330$7471c990$@gmail.com> <000c01d0e271$d9c9b080$8d5d1180$@gmail.com> <000d01d0e276$47a02400$d6e06c00$@gmail.com> Date: Sun, 30 Aug 2015 02:20:07 +1000 Subject: Re: How to reassign the value of the variable on runtime? From: Chris Angelico Cc: "python-list@python.org" 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1440865211 news.xs4all.nl 23748 [2001:888:2000:d::a6]:38163 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95756 On Sun, Aug 30, 2015 at 2:18 AM, Ivan Evstegneev wrote: > As for the globals? Each function that need to modify the globals should > contain a "global bar" inside its body? Only if it's going to _reassign_ that global. If it's going to mutate it in other ways, it doesn't need to. ChrisA