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