PEP 308 - suggestion for generalising the ternary operator

Damien Morton newsgroups1 at bitfurnace.com
Thu Feb 13 04:42:07 CET 2003


I tend to think that using the colon in a conditional selection expression
makes it hard to distinguish from a dictionary

Any comments on the original proposed form? Is the question mark as an
operator too scary?

(cond?value, cond?value, cond?value, cond?value, default_value)
(cond?true_value, false_value)
vs.
(cond:value, cond:value, cond:value, cond:value, default_value)
(cond:true_value, false_value)

some other ideas:
(cond->value, cond->value, cond->value, cond->value, default_value)
(cond->value, default_value)
or
(cond=>value, cond=>value, cond=>value, cond=>value, default_value)
(cond=>value, default_value)



"Erik Max Francis" <max at alcyone.com> wrote in message
news:3E4AE4F1.6397A292 at alcyone.com...
> Oren Tirosh wrote:
>
> > (cond:value, cond:value, cond:value, cond:value, default_value)
> >
> > Or maybe:
> >
> > (cond:value, cond:value, cond:value, cond:value, else:default_value)
>
> My first reaction is that, as a general conditoinal form, that doesn't
> look so bad.
>
> --
>  Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
>  __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
> /  \ If you can't fight and you can't flee, flow.
> \__/ Robert Elliot
>     Physics reference / http://www.alcyone.com/max/reference/physics/
>  A physics reference.
> --
> http://mail.python.org/mailman/listinfo/python-list
>








More information about the Python-list mailing list