PEP 308: Erik's alternatives list

Gerald S. Williams gsw at agere.com
Wed Feb 19 16:55:48 CET 2003


"John Roth" <johnroth at ameritech.net> wrote:
> > 1.  x if C else y
> > 2.  if C then x else y
> > 3.  if C: x else: y
> > 4.  C ? x : y
> > 5.  C ? x ! y
> > 6.  cond(C, x, y)
> > 7.  C ?? x || y
> > 8.  C then x else y
>
> Proposal 3 above requires parenthesis around it. They are
> not optional. Since 3 does, then I presume that 2 does also.

I think it's just proposal 3, and even there I'm not entirely
convinced that parentheses are always needed. I'd probably
always use them, though.

-Jerry






More information about the Python-list mailing list