Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'elif': 0.05; 'guido': 0.05; 'subject:Python': 0.06; 'dev': 0.07; 'keynote': 0.07; 'function,': 0.09; 'lawrence': 0.09; 'naturally': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'wrapped': 0.09; 'python': 0.11; 'cheers': 0.12; 'language.': 0.14; '(another': 0.16; 'block.': 0.16; 'chris,': 0.16; 'concur': 0.16; 'devs': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'switch.': 0.16; 'so.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'header:User- Agent:1': 0.23; '(or': 0.24; '---': 0.24; 'switch': 0.26; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'primarily': 0.30; "i'm": 0.30; 'easier': 0.31; 'default,': 0.31; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'like,': 0.36; 'subject:?': 0.36; 'so,': 0.37; 'two': 0.37; 'list': 0.37; '2007': 0.38; 'thank': 0.38; 'to:addr:python-list': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'read': 0.60; 'chain': 0.60; 'subject:Can': 0.60; 'most': 0.60; 'free': 0.61; 'march': 0.61; 'viruses': 0.61; "you're": 0.61; 'show': 0.63; 'high': 0.63; 'protection': 0.63; 'day.': 0.63; 'our': 0.64; 'love': 0.65; 'antivirus': 0.68; 'day': 0.76; 'potentially': 0.81; 'sir,': 0.81; 'preview"': 0.84; 'average': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Can global variable be passed into Python function? Date: Sat, 01 Mar 2014 22:01:12 +0000 References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.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> <2633c4d3-e8cc-47fa-b22a-48dab2ef1a29@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: host-78-146-12-203.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: X-Antivirus: avast! (VPS 140301-0, 01/03/2014), Outbound message X-Antivirus-Status: Clean 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: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393711293 news.xs4all.nl 2976 [2001:888:2000:d::a6]:54709 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67375 On 01/03/2014 21:40, Mark H. Harris wrote: > On Saturday, March 1, 2014 12:24:15 AM UTC-6, Chris Angelico wrote: >> much code. If you want to change anything, you potentially have to >> >> edit three places: the list of constants at the top, the condition >> >> function, and the switch. >> >> >> >> This can't be your idea of readability. Show me where I'm wrong. >> >> >> >> ChrisA > > hi Chris, I don't think you're wrong. There are two issues for me (and one of them is not how the switch is implemented). > > 1) Is it easier for average users of python as a language to read switch case default, or if elif else ? > > 2) Would most average users concur that 'readable' means something like, "readily understandable at quick glance, or rapid preview" (or quiv). > > I readily admit that 'subjective' is the operative work here. As Guido found at his 2007 keynote most experienced devs are not clamoring for a switch block. Just so. But I'm not thinking of experienced devs. I'm thinking of the average coder who is used to looking at switch blocks. > > I personally can see and understand a switch block 2x to 3x faster than looking at an elif chain. Because I am primarily a C programmer and I personally use and read switch blocks. > > An experienced python dev can readily 'see' an elif chain, well, because that's all they have and that's all they look at day to day. So, naturally a python dev is going to think an elif chain is readable. > > Thank you sir, you have good insights. A quote from the high seas is classy. > > (another post with no elipses) > > Cheers > No elipses, just the paragraphs not wrapped and the double line spacing. Good old gg, I just love it. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com