PEP 308: A PEP Writer's Experience - CON

Andrew Koenig ark at research.att.com
Sat Feb 8 18:14:59 EST 2003


Neil>    The "if" appears unnecessary to me.

Neil> condition then val1 else val2

Neil>    appears unambiguous and doesn't reuse "if". So

Neil> text += isPythonic() then "+1" else twice("minus-ungood")

This suggestion makes me nervous, even if we disregard the
extra keyword, because of the following example:

        if x then y else z:
             print "Foo"

What this would really mean is

        if x:
             p = y
        else:
             p = z
        if p:
             print "foo"

but that's sure how it appears at first glance


-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list