On Wed, 1 Feb 2006 14:57:58 -0500, "Paul Winkler" <[EMAIL PROTECTED]> said: > 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])[0]
Agreed that that works every time, but so does: (bar,foo)[bool(C)] Each to his own idioms, I suppose. > 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". Same here, but I would be +1 on a python:test method readily available in page templates _______________________________________________ Zope3-users mailing list [email protected] http://mail.zope.org/mailman/listinfo/zope3-users
