Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'causing': 0.04; 'subject:Python': 0.06; 'indicates': 0.09; 'indication': 0.09; 'invalidate': 0.09; 'lawrence': 0.09; 'page?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'subject:into': 0.09; 'encountered.': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'statement.': 0.16; 'subject:variable': 0.16; 'summary,': 0.16; 'code.': 0.18; 'rules': 0.22; 'header:User-Agent:1': 0.23; 'fixed.': 0.24; 'switch': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; "doesn't": 0.30; 'code': 0.31; 'lines': 0.31; 'url:wiki': 0.31; 'commonly': 0.31; 'exceptions': 0.31; 'existence': 0.31; 'writes:': 0.31; 'actual': 0.34; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'explains': 0.36; 'received:com.au': 0.36; 'subject:?': 0.36; 'should': 0.36; 'wrong': 0.37; 'ben': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'read': 0.60; 'course.': 0.60; 'subject:Can': 0.60; 'simply': 0.61; 'further': 0.61; 'first': 0.61; 'term': 0.63; 'more': 0.64; 'worth': 0.66; 'stated': 0.69; '100%': 0.77; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Can global variable be passed into Python function? Date: Sat, 01 Mar 2014 11:02:46 +1100 References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <5f4f5a5f-327a-4616-8235-17ee9e74c488@googlegroups.com> <530fef58$0$11113$c3e8da3@news.astraweb.com> <871tynznpd.fsf@elektro.pacujo.net> <53104798$0$11113$c3e8da3@news.astraweb.com> <87ha7jy2qs.fsf@elektro.pacujo.net> <5310b031$0$29985$c3e8da3$5496439d@news.astraweb.com> <87iorzf4ro.fsf@elektro.pacujo.net> <877g8ff3hn.fsf@elektro.pacujo.net> <87wqgfdk6a.fsf@elektro.pacujo.net> <87sir2et1d.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: vmx15867.hosting24.com.au X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:/Gs/w28JMV3QWepTMCw+ADN94W0= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393632181 news.xs4all.nl 2896 [2001:888:2000:d::a6]:47960 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67257 Marko Rauhamaa writes: > Mark Lawrence : > > > http://c2.com/cgi/wiki?SwitchStatementsSmell > > Your brief summary, please, Mark? > > Anyway, the first 1000 lines or so that I managed to read from that page > stated a valid principle, which however doesn't invalidate the existence > of a switch statement. The first sentence on that page explains that it's describing a “code smell”, with a link to the page which explains that term . Did you read that page? A code smell is an indication that something is wrong in the code. That indication is not 100% accurate; the point is that it's accurate enough to be worth further scrutiny to find what problem may be causing the smell. > However, like all other maxims, that principle, too, has exceptions. Of course. That's the point of describing something as a “code smell”: it may have exceptions where the smell does not indicate an actual problem, but those are not the normal case where the smell is encountered. More often, it indicates a problem that should be fixed. -- \ “Members of the general public commonly find copyright rules | `\ implausible, and simply disbelieve them.” —Jessica Litman, | _o__) _Digital Copyright_ | Ben Finney