Another conditional expression candidate (PEP 308)

Erik Max Francis max at alcyone.com
Mon Feb 10 22:37:50 EST 2003


Greg Brunet wrote:

> Also, from your examples, is it
> correct to assume that the "elif:" clause is NOT required?

Absolutely.  The basic form would be

	if C: x else: y

Chaining two together would result in

	if C: x else: if D: y else: z

which has an obvious contraction to

	if C: x elif: D: y else: z

All consistent with what you already know, newbie or not, about the
semantics of the if statement.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Ride / Ride this wave of mine
\__/ Res
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.




More information about the Python-list mailing list