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

holger krekel pyth at devel.trillke.net
Sat Feb 8 07:19:34 EST 2003


Laura Creighton wrote:
> > Skip> Well understood.  It's a 90% solution, and for the other 10%
> > Skip> where I'd have to resort to something like
> > 
> > Andrew> (<cond> and [expr1] or [expr2])[0]
> > 
> > Skip> I punt and use an if statement.
> > 
> > The contexts in which I would like to be able to use an if-expression
> > are precisely those, such as function arguments and lambda expressions,
> > where if statements aren't allowed.
> > 
> > -- 
> > Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
> 
> Thus answering the question 'if we let it in will we get code that
> is hard to read'.  I want my control flow with indentation, please.

very good point. 

    holger





More information about the Python-list mailing list