Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'forgive': 0.05; 'subject:Python': 0.06; 'advocate': 0.07; 'feature,': 0.09; 'friday,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rewrite': 0.09; 'structure,': 0.09; 'subject:into': 0.09; 'python': 0.11; 'default:': 0.16; 'mark,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'received:comcast.net': 0.24; 'switch': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'statement': 0.30; 'skip:_ 10': 0.34; 'case,': 0.35; 'but': 0.35; 'there': 0.35; 'subject:?': 0.36; 'effort': 0.37; 'expressed': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'chain': 0.60; 'subject:Can': 0.60; 'issues,': 0.61; 'show': 0.63; 'batchelder': 0.84; 'conclude': 0.84; 'etc,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: Can global variable be passed into Python function? Date: Fri, 28 Feb 2014 21:15:38 -0500 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> <0b414429-74ee-45dd-9465-c87e98c362f2@googlegroups.com> <4bd11eec-395a-4484-a991-9fabf12328e1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: c-50-133-228-126.hsd1.ma.comcast.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <4bd11eec-395a-4484-a991-9fabf12328e1@googlegroups.com> 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393640151 news.xs4all.nl 2840 [2001:888:2000:d::a6]:43777 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67284 On 2/28/14 8:08 PM, Mark H. Harris wrote: > On Friday, February 28, 2014 6:40:06 PM UTC-6, Ned Batchelder wrote: > >> >> I don't understand: you show an if/elif chain that cannot be expressed >> as a switch statement (because it uses < ), and then conclude that >> Python needs a switch statement? That doesn't make any sense. >> > > Forgive me. I would rewrite the structure, > > switch x: > case GT_1: > __atan__Gt_1__(x) > case LT_1: > __atan__Lt_1__(x) > case IS_1: > a = gpi/4 > case IS_n1: > a = -gpi/4 > default: > __atan__(x) > > or somesuch... way better... yes, there are some issues, but all workable with some effort > Mark, if you are going to advocate for a feature, find a good use case, this one is absurd. Where did the constants GT_1 etc, come from? -- Ned Batchelder, http://nedbatchelder.com