Draft Pep (was: Re: Let's Talk About Lambda Functions!)
Duncan Booth
duncan at NOSPAMrcp.co.uk
Wed Aug 7 05:38:26 EDT 2002
Greg Ewing <see_reply_address at something.invalid> wrote in
news:3D509ACE.9070908 at something.invalid:
> <expr> if <expr> else <expr>
>
> The BDFL doesn't like it, though, which is a pity, because
> I think it's one of the more elegant things to come out of
> the ever-recurring ?: wars.
Not having spotted that particular flame war, may I ask whether this would
be interpreted as:
<expr> if <condition> else <expr>
or
<condition> if <expr> else <expr>
The first one would seem more intuitive except for the else part. The
second one is obviously wrong (condition before the if), but would probably
be expected by C programmers.
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list