Can global variable be passed into Python function?

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Mar 1 17:01:12 EST 2014


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





More information about the Python-list mailing list