For review: PEP 308 - If-then-else expression

Tim Peters tim.one at comcast.net
Sat Feb 8 15:31:22 EST 2003


[Tim]
> Just noting that if the proposal is accepted, we can get rid of
> those pesky "and" and "or" operators:
>
>     x and y    same_as    y if x else x
>     x or y     same_as    x if x else y
>
> Removing two things each time a new one is added is an effective way
> to keep the language small <wink>.

[François Pinard]
> x and/or y may be complex denotations, in which case the `if-else'
> writing could be cumbersome by comparison.
>
> This is a bit like rewriting `a += 1' into `a = a + 1', which
> hurts when `a' is not a simple denotation.

At least one of these two statements is true:

1. I was joking.

2. I'm going to follow up with a proposal banning complex denotations
   except on the right hand side of single-target assignment statements.

one-statement-at-most-one-operator<wink>-ly y'rs  - tim







More information about the Python-list mailing list