[Python-Dev] Re: Decorators: vertical bar syntax
Marco Bubke
marco at bubke.de
Sun Aug 8 08:52:10 CEST 2004
Edward Loper wrote:
> The new "vertical bar" syntax was proposed recently, and has gotten
> almost unanimously positive feedback. In particular, of 17 responses
> to the syntax, only one has been negative (see table, below).
>
> I'm including both of the following variants:
>
> |classmethod
> |accepts(int, int)
> |returns(float)
> def foo(arg1, arg2):
> ...
>
> def foo(arg1, arg2):
> |classmethod
> |accepts(int, int)
> |returns(float)
> ...
I really like the second one maybe with '@'. For me a decorator is a
property of the function like the attributes. I think this is function foo
with two arguments, its a classmethod etc.. The function name and the
arguments are much more important for me than the decorators. So they
should be go after the doc string.
Marco
More information about the Python-Dev
mailing list