On Nov 25, 7:43 am, Paul Rubin wrote:
> Gerald Britton writes:
> > if v:
> > f()
>
> > I might, however, think more in a functional-programming direction.
> > Then I might write:
>
> > v and f()
>
> Python has conditional expressions. The above would be:
>
> f() if v else Non
Gerald Britton writes:
> if v:
> f()
>
> I might, however, think more in a functional-programming direction.
> Then I might write:
>
> v and f()
Python has conditional expressions. The above would be:
f() if v else None
using "and" is bug-prone.
--
http://mail.python.org/m
Gerald Britton writes:
> Writing in Python gives me the luxury of choosing different paradigms
> for similar operations. Lately I've been thinking about a minor
> detail that peaked my interest and am curious what others think:
>
> Say that I have some function "f" that I will execute if some va
Both paradigms are in the bash shell. Using a test switch (like -x for
executiable) mixed with an && or ||.
Example:
[-x /usr/bin/firefox ] || exit
I think it's very clear, to old hands, but not so much for a new or
intermediate users.
It certainly is the 'cleaner' form. Like the C styl
On Nov 24, 2010, at 1:46 PM, Gerald Britton wrote:
> Say that I have some function "f" that I will execute if some variable
> "v" evaluates true. Using a classical procedural approach, I might
> write:
>
>if v:
>f()
>
> I might, however, think more in a functional-programming direct
On Nov 24, 11:46 am, Gerald Britton wrote:
> Say that I have some function "f" that I will execute if some variable
> "v" evaluates true. Using a classical procedural approach, I might
> write:
>
> if v:
> f()
>
> I might, however, think more in a functional-programming direction.
> T
Writing in Python gives me the luxury of choosing different paradigms
for similar operations. Lately I've been thinking about a minor
detail that peaked my interest and am curious what others think:
Say that I have some function "f" that I will execute if some variable
"v" evaluates true. Using