A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-April/043908.html below:

[Python-Dev] Re: PEP 318: Decorators last before colon

[Python-Dev] Re: PEP 318: Decorators last before colonPhillip J. Eby pje at telecommunity.com
Thu Apr 1 12:47:11 EST 2004
At 09:08 AM 4/1/04 -0800, Michel Pelletier wrote:
>Later, Guido said:
>
> > 3) Prefix suite (could use a different keyword than 'decorate'):
> >
> >    decorate:
> >        funcattrs(foo=42)
> >        deprecated
> >        overrides
> >        classmethod
> >    def foo(cls, arg1, arg2):
> >        pass
>
>
>I don't really like it, but it's the only one that looks like Python to
>me.  Otherwise, I vote last-before-colon.  Line-preceding-def would be
>my last choice.

There is another option:

     as [classmethod]
     def blah(cls):
         ...

     as [singleton]
     class SignalManager:
         ...

     as [implementorOf(IFoo, forTypes=[Bar])]
     class FooToBarAdapter:
         ...

and it could also be on the same line, e.g.:

     as [classmethod] def blah(cls):
         ...

It reads a bit better with function definitions than with classes, but it's 
not too bad.  It's more of a replacement for the *[decorators] syntax than 
the 'decorate:' syntax, but it's an English word rather than a symbol, 
which brings back a bit more of the "Python look and feel".


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