PEP-308 a "simplicity-first" alternative

Piet van Oostrum piet at cs.uu.nl
Sat Feb 15 17:52:56 EST 2003


>>>>> "Paul Paterson" <hamonlypaulpaterson at houston.rr.com> (PP) wrote:

PP> "Christian Tismer" <tismer at tismer.com> wrote in message
PP> news:mailman.1045015194.30601.python-list at python.org...
>> 
>> Anyway, please show me any other proposal that is
>> as minimalistic as this one. Please, stare at it
>> a little while and weight it's impact to the simplicity
>> of the language, readability, ease of impl, and getting
>> all these threads to a happy shut-down (or -up).

PP> I still like the minimalism of,

PP> x or y if C

PP> As in,

PP> val = sqrt(x) or "imaginary" if x<0

The "or" should be "but".
But as "but" would be a new keyword, "except" may be better:

val = sqrt(x) except "imaginary" if x<0

Still I don't like it as the order isn't good. When there is a "normal"
case and an "exceptional" case, OK, but if the true and false cases are
more or less equally ocurring the if should be first.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl




More information about the Python-list mailing list