On Wed, Feb 01, 2006 at 01:38:15PM -0600, Michael Dudzik wrote: > But why not just use (bar,foo)[C] in all cases, regardless of the value > of bar or foo?
Because it always evaluates both foo and bar, and sometimes you can't afford that (e.g. if they are expensive expressions rather than simple variables). Prior to python 2.5, there is AFAIK no other always-works short-circuiting one-line conditional expression but this: (bool(C) and [foo] or [bar]) Generally I only care about this in TALES expressions; in python I prefer to use the extra couple of lines to use "if" and "else". -- Paul Winkler http://www.slinkp.com _______________________________________________ Zope3-users mailing list Zope3firstname.lastname@example.org http://mail.zope.org/mailman/listinfo/zope3-users