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

[Python-Dev] Re: Decorators: vertical bar syntax

[Python-Dev] Re: Decorators: vertical bar syntax [Python-Dev] Re: Decorators: vertical bar syntaxMarco 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

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