PEP-0318

Roy Smith roy at panix.com
Sat Aug 7 01:46:32 CEST 2004


Mark Bottjer <mark_bottjer at hotmail.com> wrote:

>      E. pie decorator at top of function body syntax
> 
>      def foo(arg1,arg2):
>          @classmethod
>          ...
> 
>      def bar(low,high):
>          @accepts(int,int)
>          @returns(float)
>          ...
> [...]
>      * 0 Perhaps decorators should be allowed before or after the
>          docstring. If you have to choose, I'd choose making it before
>          the docstring.

It's a pretty arbitrary decision (i.e. I can't see any strong arguments 
one way or the other) which means it's the kind of thing which is likely 
to not be remembered.  I think I'm with you, decorators come first, then 
the docstring.  But pick one and stick with it, so everybody does it the 
same way.

>      * - Lots of decorators will make it harder to find the start of the
>          function implementation. Then again, so will a large docstring.

Do people anticipate having lots of decorators for a given function?



More information about the Python-list mailing list