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

Stephen Horne intentionally at blank.co.uk
Wed Mar 5 16:57:50 CET 2003


On Wed, 5 Mar 2003 09:38:21 -0500, "Terry Reedy" <tjreedy at udel.edu>
wrote:

>please at least spell it right.

I, for one, don't care how bad someones spelling is as long as I can
read it. 


>How does 'C op1 b op2 c', when performing a conditional selection
>operation, violate the 'fundamental principle of readibility',
>whatever that is, any more than any other five-token expression, such
>as 'a + b * c' or 'a <= b <= c'?

Here, I absolutely agree with you - I see no reason to force
linebreaks in expressions - readability is best served by human
judgement, not absolute rules.

If I want to write, for example...

  a =   (if (b != 0) then a/b else 1000)
      + (if (d != 0) then c/d else 1000)
      + (if (h != 0) then g/h else 1000))

... then readability is best served by keeping each conditional on a
single line so that vertical alignment can emphasize the pattern.

That said, I think that some form of 'select' could have merit - but
as an alternative to, rather than a replacement for, a simpler
conditional expression notation.

-- 
steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list