PEP 308: an additional "select/when" survey option
Clark C. Evans
cce at clarkevans.com
Wed Mar 5 00:12:50 EST 2003
On Tue, Mar 04, 2003 at 09:41:01PM -0500, Steven Cummings wrote:
| Will this syntax be pursued separately if it does not become the
| lead nomination for PEP308? I wouldn't mind seeing both this
| switch-case syntax in addition to what I've already selected
| in the PEP308 vote.
I don't intend to prusue this much further, someone else is
welcome to pick up the cause...
I just started the option beacuse I didn't like the path that
the terinary expression options were taking. Rather than poo-poo
the option, I was just looking for an alternate suggestion that
would make me happy.
A good solution to this problem will:
a) maintain python's indentation for displaying scope,
in other words, just beacuse it is an expression and
not a block construct doesn't mean it can't use
indentation wisely; and
b) facilitate greater code maintenance by allowing the
compiler to fill in redundant code intelligently; and
c) provide 'general' conditional logic through an
expression instead of a statement so that I an stop
abusing mappings...
All of the options on the table may do (c) and some of (b),
but most fail at (a) since they allow for the entire
exprssion to be jammed into a single line... ick.
Just doing my best to avoid 132 column python code,
Clark
More information about the Python-list
mailing list