Re:The Python IAQ: Infrequently Answered Questions
by IgorPartola on Friday November 12, 2010 @08:59AM
(#1897631)
As pointed out in the OP, there are actually quite a lot of ways to simulate the ternary operator in Python. An interesting one is (result, alternative)[test]. If result and alternative are functions you could write it as (result, alternative)[test]().
And for desert: I love this syntax:
For more info see: http://stackoverflow.com/questions/394809/python-ternary-ope...