[Python-Dev] Re: Re: def fn (args) [dec,dec]: (original) (raw)
Christophe Cavalaria chris.cavalaria at free.fr
Mon Aug 9 20:43:05 CEST 2004
- Previous message: [Python-Dev] Re: def fn (args) [dec,dec]:
- Next message: [Python-Dev] Re: def fn (args) [dec,dec]:
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Greg Ewing wrote:
Guido:
Just look at it when either the list of decorators or the argument list doesn't fit on one line: You don't have to format it quite that badly. def longMethodNameForEffect(longArgumentOne=None, _longArgumentTwo=42) _ [staticmethod, funcattrs(grammar="'@' dottedname [ '(' [arglist] ')' ]", status="experimental", author="BDFL")]:
Am I the only one who finds that it's :
- ugly
- incredibly error prone due to a lot of special cases on each line of code
- a back door for the "how to indent C code" flamewars in Python
I guess it depends on the amount of decorators you will place on each function. If you place 3-4 decorators per function ( it could easily happen once we get a good and easy to use syntax ), we'll favor a syntax that makes multiline decorator declaration clear and easy to type. The [...] doesn't apply.
On a readability point of view, the @ syntax scales much better with a big number of decorators than the [...] syntax.
Also, the decorators don't have that much effet on what happens between the def and the return. For that reason I find it a mistake to place any decorator information after the def statement.
- Previous message: [Python-Dev] Re: def fn (args) [dec,dec]:
- Next message: [Python-Dev] Re: def fn (args) [dec,dec]:
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]