Hrvoje Niksic wrote:

If you want lazy evaluation, you can use lambdas:

iif(cond, lambda: then, lambda: else_)()

Your code uses "iif" and attempts to evaluate a tuple; could you post
an example that works?

I ask because it's not clear what you mean by lazy evaluation in this
context.  The ternary "if" expression introduced in Python 2.5 only
evaluates then_value or else_value depending on the outcome of cond.
How is that different than using a lambda?

the second part of Diez' answer is a reply to the second part of the OP's question.

</F>

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to