For review: PEP 308 - If-then-else expression

Anthony Baxter anthony at interlink.com.au
Sun Feb 9 23:02:56 EST 2003


>>> Erik Max Francis wrote
> 	(if C: x else: y)
> 	(if C1: x elif C2: y else: z)

This is far preferable to the current PEP suggestion. In particular, 
the brackets make it clearer that this is _not_ an "if statement", but
an "if expression".

Mind you, I'd still prefer it not be spelled 'if' - and I'm not sure
that allowing elif isn't going to lead to some shockingly appalling 
multi-line horrors.

Anthony

-- 
Anthony Baxter     <anthony at interlink.com.au>   
It's never too late to have a happy childhood.






More information about the Python-list mailing list