[Python-Dev] Re: new syntax for wrapping (PEP 318)
Mark Russell
marktrussell at btopenworld.com
Wed Feb 25 18:33:40 EST 2004
On Wed, 2004-02-25 at 22:37, Skip Montanaro wrote:
> 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):
I think the reason why this (and the proposed method annotation syntax)
is readable is that it reads as a parenthetical note [i.e. something
that is intended to convey a bit of extra information].
It would be interesting to show
def foo(self) [classmethod]:
to a relative python beginner and ask them the guess at the meaning. My
hunch is that they would assume that "[classmethod]" modifies the
meaning of the function defintion in some way. The curious could then
look up classmethod in the manual, where they would presumably find a
note about the [] syntax.
Mark Russell
More information about the Python-Dev
mailing list