Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'type,': 0.07; 'attribute.': 0.09; 'elegant,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'global,': 0.09; 'message-id:@stoneleaf.us': 0.09; "didn't,": 0.16; 'wrote:': 0.16; 'thoughts': 0.18; 'module': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'have,': 0.27; '~ethan~': 0.29; '(which': 0.29; 'function': 0.30; 'probably': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'false': 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; 'charset:windows-1252': 0.65; 'received:10.1.10': 0.84; 'subject:Set': 0.91 Date: Mon, 15 Jun 2015 17:19:59 -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> In-Reply-To: <557f6676$0$21718$c3e8da3@news.astraweb.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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434414016 news.xs4all.nl 2932 [2001:888:2000:d::a6]:52247 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92646 On 06/15/2015 04:57 PM, Steven D'Aprano wrote: > Thoughts and feedback? Please vote: a module global, or a flag on the > object? Please give reasons, and remember that the function is intended > for interactive use. Function attribute. Setting a global on the module (which I may not have, and probably didn't, import) for only one function is overkill. edir.dunders = False # or True is simple, elegant, easier to type, and perfectly in keeping with Python's dynamic nature. -- ~Ethan~