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

[Python-Dev] Decorators with arguments are curries!

[Python-Dev] Decorators with arguments are curries! [Python-Dev] Decorators with arguments are curries!Nick Coghlan ncoghlan at iinet.net.au
Wed Aug 11 07:47:20 CEST 2004
Phillip J. Eby wrote:
> At 10:36 PM 8/7/04 +1000, Andrew Durdin wrote:
> 
>> def bar_decorator(func, param):
>>     print param
>>     return func
>>
> Decorator syntax does *not* provide currying.  You have to write 
> something like this:
> 
Or, if the 'partial' function is in the standard lib by that point, you
can use it to get your decorator. . .

X>>> @partial(bar_decorator(param_val))
X... def myFoo(): pass

Cheers,
Nick.

(P.S. Does the interactive interpreter currently do a line continuation
after the decorator line?)

-- 
Nick Coghlan               |  Eugene, Oregon
Email: ncoghlan at email.com  |             USA




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