A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047126.html below:

[Python-Dev] Re: def fn (args) [dec,dec]:

[Python-Dev] Re: def fn (args) [dec,dec]:Brad Clements bkc at murkworks.com
Fri Aug 6 17:22:33 CEST 2004
On 6 Aug 2004 at 7:45, Guido van Rossum wrote:

> Just look at it when either the list of decorators or the argument
> list doesn't fit on one line:

Could the decorator list be treated specially, like a docstring?

class C(object):

    def longMethodNameForEffect(longArgumentOne=None,
                                longArgumentTwo=42):
        [
            staticmethod,
            funcattrs(grammar="'@' dotted_name [ '(' [arglist] ')' ]",
                      status="experimental", author="BDFL")
        ]
        """This method blah, blah.

        It supports the following arguments:
        - longArgumentOne -- a string giving ...
        - longArgumentTwo -- a number giving ...
        """


compare to:

class C(object):

    @staticmethod
    @funcattrs(grammar="'@' dotted_name [ '(' [arglist] ')' ]",
                      status="experimental", author="BDFL")
    def longMethodNameForEffect(longArgumentOne=None,
                                longArgumentTwo=42):
        """This method blah, blah.

        It supports the following arguments:
        - longArgumentOne -- a string giving ...
        - longArgumentTwo -- a number giving ...
        """



-- 
Brad Clements,                bkc at murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
http://www.wecanstopspam.org/                   AOL-IM: BKClements

More information about the Python-Dev mailing list

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