PEP 308: "then" "else" for deprecating "and" "or" side effects

François Pinard pinard at iro.umontreal.ca
Fri Feb 14 09:34:27 EST 2003


[Christian Tismer]

> Dear community,

Nice way to salute! :-)

> there has been some favor of my silly/simple a then b else c proposal.

Not so long ago, I added a similar feature in an ad hoc language we created
for one project (French and specialised syntax, and written under pressure).
Strangely enough, it did not occur to me, before this morning, that there
was some relation with this long thread in the Python universe. :-)

If I translate the keywords of our syntax back to English, it gives:

    a when b else c

with a chainable property not requiring parentheses:

    a when b else c when d else ...

Our language is declarative (tinily functional) rather than imperative.
Yet, the above writings are not far from the original Guido suggestion.

I know I'm merely throwing yet another idea is this already overlong thread,
which I did not even attempt to read wholly.  Maybe the above has been
suggested already.  I've no intention whatsoever of pushing or defending it.

My opinion on PEP 308 is that, whatever is done or not done, the key to the
final decision should be the continued legibility of the Python language,
much more than the tiny bit of added functionality.  It just happens that
for our little language, _not_ Python, the above has been received as quite
natural and legible by the non-programmers in the project -- they used that
language heavily for providing that knowledge base the project needed.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list