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-February/042727.html below:

[Python-Dev] Re: new syntax for wrapping (PEP 318)

[Python-Dev] Re: new syntax for wrapping (PEP 318) [Python-Dev] Re: new syntax for wrapping (PEP 318)Skip Montanaro skip at pobox.com
Wed Feb 25 17:37:26 EST 2004
    Mark> Just a data point from a user: I use classmethod fairly
    Mark> frequently, and I would *love* to see some syntax to support it.
    Mark> As has been pointed out before, classmethod (and staticmethod) are
    Mark> a part of the interface of a function, and shouldn't be tacked on
    Mark> to the end of the body. Please let me put them where people (and
    Mark> hopefully pydoc and pychecker) can easily see them.

    Mark> I marginally prefer [] to "as", but I don't have strong feelings
    Mark> either way.  Both seem quite readable and pythonic to me.

I'll add another data point.  Quixote'd PTL uses almost this exact syntax to
distinguish between PTL functions/methods which return HTML or plain text.
The only difference is that it places the annotation before the argument
list:

    def head [html] (title):
        '''
        <head>
        <title>%(title)s</title>
        ''' % locals()

        threecol_css()

        '</head>'

I haven't heard any Quixote users complain about the construct.  (I don't
know if PTL supports more than one annotation per function or not.  I think
the only choices are currently "html" or "text", which are obviously
mutually exclusive.)

Skip

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