Possible PEP: Improve classmethod/staticmethod syntax

Duncan Booth duncan at NOSPAMrcp.co.uk
Fri Jun 6 05:46:05 EDT 2003


"Sean Ross" <sross at connectmail.carleton.ca> wrote in 
news:9HRDa.4706$IR1.570080 at news20.bellglobal.com:

> # version with sugar
> def foo() as static,
>                      synchronized,
>                      contract(pre,post):
>         ...do stuff...

I don't think this quite works as stated.
Python lets you break a line inside a parenthesised expression or with a 
continuation character, so it seems to me that this proposal would require 
one of the following:

def foo() as (static,
              synchronized,
              contract(pre,post)):
    pass

or:

def foo() as static, \
             synchronized, \
             contract(pre,post):
    pass

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