Another conditional expression candidate (PEP 308)

Anders J. Munch andersjm at dancontrol.dk
Tue Feb 11 03:29:44 EST 2003


"Erik Max Francis" <max at alcyone.com> wrote:
> Evan wrote:
> 
> > This is part of why I suggested mandatory parens.  Then both of these
> > are legal, and there is no confusion:
> > 
> > result = (if cond: x else: y)
> > 
> > result = (if cond:
> >      x
> > else:
> >      y)
> 
> Why make them mandatory?  If you want to go multiline, you can just add
> the parentheses yourself and get them for free.  Making them mandatory
> seems heavy handed for getting a certain indentation flow you _might_
> want to use.

The BDFL shot down the straight, parentheses not required version, in
the pep.  Looks too much like a statement.  Perhaps requiring
the parentheses that I would have used anyway will mend that.

just-trying-to-force-my-preferred-style-down-everybody's-throat-ly
y'rs, Anders






More information about the Python-list mailing list