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="'@' dotted_name [ '(' [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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4