One-liner blocks (was Re: accessing a functions var from a subfunction.)
Courageous
jkraska at san.rr.com
Thu Apr 17 11:46:11 EDT 2003
>Having MTOWTDI ain't Pythonic. The ability to write either:
>
> if finished: break
>
>OR quite equivalently
>
> if finished:
> break
>
>is therefore a wart.
Hrm. Conceputalization? I consider these two equivalent. I suppose
it's bias. Years of using languages where WSDM (white spaces don't
matter), allows me to elide away some under some circumstances. :)
BTW, there's a thing I do in some programming environments, that
I personally really like to do, but I see few other people do. I'll
show you:
if (alpha) { DoSomething(); return x; }
if (beta) { DoSomethingElse(); return y; }
if (delta) { DoOtherThing(); return z; }
I like to use *columns*, in other words. I find this to be neat and
readible, and considerably superior to what would otherwise pass as
the defacto alternative.
I think you'll see how the example applies to the thread's subject...
C//
More information about the Python-list
mailing list