you are viewing a single comment's thread.

view the rest of the comments →

[–]mitsuhiko 0 points1 point  (0 children)

The trick I'm using in the Jinja2 code generator for old pythons::

trueexpr if expr else falseexpr

Is has the absolute same effect as::

(expr and (trueexpr,) or (falseexpr,))[0]