PEP 308: an additional "select/when" survey option

Erik Max Francis max at alcyone.com
Wed Mar 5 08:33:35 CET 2003


"Clark C. Evans" wrote:

> Quite right. A switch/case statement isn't at issue for PEP 308,
> and I was incorrect to label this proposal as such -- switch/case
> is a block level construct which contains statements.  I'm not
> proposing that.

I understand that.  I (on autopilot) retyped what you wrote, but I
understood what you were suggesting.  As I said, it is really beyond the
scope of PEP 308; it should be in another PEP.

> This proposal is for a select/when *expression* which is simply
> a generalization of a terinary operator, and equivalent to
> some of the "elif" like options on the table.  So, this
> proposal fits right in with the spirit of the PEP.

It's something that could degenerate to a ternary (or trinary, but not
terinary) operator, but it in and of itself is a more generalized
construct and so is not appropriate for a PEP 308 vote.  If you want to
suggest a generalized select/when (or whatever you want to call it) and
propose that, that's fine, but it would be for another PEP.

Take people who wanted to implement ternary operators in terms of a
special syntax for zero-argument lambdas and a new builtin; this
degenerates to a ternary (or can be used as one), but really deserved to
be suggested under another PEP; and, indeed, it was.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ I like young girls.  Their stories are shorter.
\__/ Thomas McGuane
    Crank Dot Net / http://www.crank.net/
 Cranks, crackpots, kooks, & loons on the Net.




More information about the Python-list mailing list