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

[Python-Dev] Re: decorators and 2.4

[Python-Dev] Re: decorators and 2.4 [Python-Dev] Re: decorators and 2.4David Abrahams dave at boost-consulting.com
Fri Jun 25 20:41:54 EDT 2004
"Fred L. Drake, Jr." <fdrake at acm.org> writes:

> On Friday 25 June 2004 04:09 pm, Phillip J. Eby wrote:
>  > * Whether to have a 'decorate' function at all, or whether it's better to
>  > just list specialized decorator objects/functions (I generally favor the
>  > latter, since 'decorate' is IMO a dead chicken that hasn't appeared in any
>  > widely-supported syntax proposals to date).
>
> Ooohh... time for some fun!  Some proposals have included "as".  Since "as" 
> isn't really a keyword, how about:
>
>     from decorate import decorate as as
>
>     as(classmethod)
>     def myAlternateConstructor(...):
>         # make something interesting:
>         return 42
>
> Too bad this is ugly for the simple attribute decorator:
>
>     as(spam="fidget")
>     def foo(...):
>         send_fred_more_spam_please()
>

I don't find it so ugly... but then there's always "with" ;-)

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com


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