Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >> Personally, between >> >> * foo if foo else bar >> * foo or bar >> >> I prefer the second. Maybe it could be spelt >> >> * foo else bar ? >> > How about > > val = foo rather than bar > > If that is not clear and obvios, I don't know what is. ;) > > /W Excellent suggestion, and obviously its semantics should be:
val = foo if bar else foo and so, some might argue for: val = foo despite bar which would allow more aggressive short-circuiting. However, I'm not sure how useful this is in practice. M -- http://mail.python.org/mailman/listinfo/python-list