"John J Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The stricter form where you don't allow 'elif' will get used in more
> restricted circumstances, so gives less encouragement for widespread
> abuse
> of conditional expressions by people who don't like whitespace-based
> syntax.
I think 'abusiveness' is somewhat in the eye of the beholder here. In any
case, without 'elif', one could still chain expressions by writing
x = (if a then b else
(if c then d else
e))
which is even more Lispish. I personally think one () is enough and prefer
x = (if a then b
elif c then d
else e)
which is similar to how I wrote such things in C. Elif has the same
justification here as with the statement form, where it is also unnecessary
but saves nesting levels.
Terry J. Reedy
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com