Another stab at a "switch/case" construct (for Python 3000):

Jeff Shannon jeff at ccvcorp.com
Thu Mar 28 15:15:31 EST 2002


Dale Strickland-Clark wrote:

>
> Alternatively, capitalise Java-style: 'matchOn' or 'switchOn'

Ugh.  Please, no.  I wince every time I see that horrid capitalization
style.  If *any* letters are capitalized, the first letter *must* be,
also. (At least, in my mind... I realize that this is a matter of personal
taste, but it's one that I feel *very* strongly about.)  But since
currently, all Python keywords are all lower-case, then we should maintain
that tradition.  I think that if we're going to add a keyword for this,
that "switch" is a good choice.  It's familiar to C/C++ programmers (at
least), it's reasonably intuitive, and it avoids capitalization
monstrosities. ;)  It does risk breaking old code, of course, but then,
*any* keyword change does that.

I do prefer the re-use of "else" instead of adding "any", though. A lot.
:)

Jeff Shannon
Technician/Programmer
Credit International







More information about the Python-list mailing list