Proposal: function which simulates C ?: operator

Tor Iver Wilhelmsen tor.iver.wilhelmsen at broadpark.no
Sun Jul 11 16:48:05 EDT 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

>   (lambda: g(x), lambda: f(x))[bool(condition)]()

Since you call the object afterwards, you don't need the lambdas
(which add a layer of indirection), just the function references:

(g, f)[bool(condition)]()



More information about the Python-list mailing list