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

[Python-Dev] Decorators: vertical bar syntax

[Python-Dev] Decorators: vertical bar syntaxHeiko Wundram heikowu at ceosg.de
Sat Aug 7 11:27:04 CEST 2004
Am Samstag, 7. August 2004 06:35 schrieb Edward Loper:
> 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 prefer the second, but would be happy with either.)

-0.5 for the first, because | hard to read (I just noticed that in my eMail 
client), and -1 for the second, because decorating a function (some of you 
suggested even _after_ the docstring) in the actual function takes away all 
there is to decorators: making it immediately clear that a function is being 
decorated. If we would have to specify decorators after the actual def and 
the doc-string, there'd be no need for decorators, as that's what we can do 
at the moment too.

Heiko.
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