Style question for conditional execution

Paul Rubin at nospam.invalid
Wed Nov 24 21:43:18 CET 2010

Gerald Britton <gerald.britton at> 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.

More information about the Python-list mailing list