PEP308: a call for usability studies (was Re: Update to PEP308: if-then-else expression)

Bengt Richter bokr at oz.net
Fri Feb 14 18:06:55 EST 2003


On 13 Feb 2003 17:49:55 -0800, Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
[...]
>
>So I just don't see any reason to get uppity about fending off
>language features that are present in so many other languages without
>drawing complaints.  That includes not only conditional expressions,
>but also case statements, repeat/until loops, etc.  Python seems
>to be acquiring such features one by one (operators like += appeared
>only recently) -- why not just realize that including them is logical,
>and not make such a fuss?
But
    c?x:y

is so cryptic, whereas three well-chosen keywords could make the
expression so much more obvious in its meaning, e.g.,

    evaluateTheBoolValueOf c thenIfItIsTrueGetThisExpressionValueByEvaluating x otherwiseGetThisExpressionValueByEvaluating y

of course you may want to take advantage of newline freedom within parens:

    (evaluateTheBoolValueOf c
       thenIfItIsTrueGetTheValueOfThisExpressionByEvaluating x
       otherwiseGetTheValueOfThisExpressionByEvaluating y)

;-)

Regards,
Bengt Richter




More information about the Python-list mailing list