Dennis Lee Bieber wrote: > On 27 Apr 2007 08:34:42 -0700, Paul McGuire <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>deficient - ternary expressions are now part of the language after >>years of refugees from C and C++ asking how to write "a = b ? c : d", >>and now they'll get to puzzle/gripe over mapping this to "a = c if b >>else d". But as a newbie, you need to invest a little more time and > > > And I'll probably ignore those expressions whenever I do get around > to 2.5+... That syntax, in my mind, just... stinks...
ALGOL used "expression IF"; you could write x := (IF a > b THEN a ELSE b); but that doesn't map well to an indentation-based language. A syntax suitable for Python, now that there's a bool type, might be to define ".if()" for "bool". Then one could write (a > b).if(a,b) which is better than adding an operator. Such things are useful in formatting expressions. msg = 'Unit is %s' % (unitstatus.if("on","off"),) but not really essential. John Nagle -- http://mail.python.org/mailman/listinfo/python-list