Andrew Durdin wrote: > def bar_decorator(func, param): > print param > return func > > @foo_decorator > @bar_decorator("one param here") > def decorated_func(): > pass > > Here the first decorator statement is bare, while the second one > includes parentheses and an argument; the first one looks like a > function reference, while the second looks like a function call. Correct. And that is indeed the intended meaning. Did you try this out? It gives Traceback (most recent call last): File "b.py", line 9, in ? @foo_decorator TypeError: bar_decorator() takes exactly 2 arguments (1 given) (although, as you can see, the line number is off by one) See http://www.python.org/dev/doc/devel/ref/function.html on why this is so. > Most of my concern here is that this aspect of decorator syntax > appears to be implicitly introducing a currying syntax in one special > circumstance, which is then *not* transferable to currying functions > in normal situations, as it would conflict with function calling. And yet, the proposal does no such thing. Regards, Martin
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