Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'globals': 0.09; 'message-id:@stoneleaf.us': 0.09; 'appropriate': 0.14; "didn't,": 0.16; "module's": 0.16; 'runs.': 0.16; 'wrote:': 0.16; 'pieces': 0.18; 'am,': 0.23; 'module': 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'have,': 0.27; 'module.': 0.27; 'piece': 0.29; '~ethan~': 0.29; '(which': 0.29; 'function': 0.30; 'code': 0.31; 'probably': 0.32; 'michael': 0.33; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'really': 0.35; 'received:10': 0.37; 'setting': 0.37; 'subject:: ': 0.37; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'subject:the': 0.40; 'even': 0.61; 'charset:windows-1252': 0.65; 'received:10.1.10': 0.84; 'ethan': 0.91; 'furman': 0.91; 'subject:Set': 0.91 Date: Tue, 16 Jun 2015 07:57:07 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Set a flag on the function or a global? References: <557f6676$0$21718$c3e8da3@news.astraweb.com> <557F6BAF.3080702@stoneleaf.us> <55802B05.1050807@gmail.com> In-Reply-To: <55802B05.1050807@gmail.com> Content-Type: text/plain; charset=windows-1252; 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434466638 news.xs4all.nl 2895 [2001:888:2000:d::a6]:42996 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92680 On 06/16/2015 06:56 AM, Michael Torrie wrote: > On 06/15/2015 06:19 PM, Ethan Furman wrote: >> >> Setting a global on the module (which I may not have, and probably >> didn't, import) for only one function is overkill. > > What do you mean? Even if you pull in just one function from the > module on an import, the module's initialization code still runs. For me, an appropriate use of globals requires that it will be used by many other pieces of code in that module. If only one piece of code is using it, it's not really global. -- ~Ethan~