Update to PEP308: if-then-else expression

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Feb 11 11:12:33 EST 2003


Max M <maxm at mxm.dk> wrote in 
news:9T82a.76801$Hl6.7572259 at news010.worldonline.dk:

> And what is this with parens that has to be there? This is so 
> inconsistent with how parens are used normally in Python. Normally they 
> are only needed for tuples, functions and multiline statements.

Parentheses are not needed for tuples (except the empty tuple).

-- 
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