> The primary issues were: (1) That decorators with vs. without > arguments look inconsistent, like function calls vs. function > references, and (2) that consequentially, decorator syntax is > implicitly introducing a non-viable currying syntax. I think you're mistaken. When using @foo, foo should be a function taking one argument; when using @foo(x,y,z), the *call* to foo(x,y,z) should return a function of one argument (or an equivalent callable object, of course). This is often done by defining an inner "helper" function, e.g.: def funcattrs(**kwds): def helper(func): func.__dict__.update(kwds) return helper @funcattr(counter=42, obsolete=True) def foobar(): pass --Guido van Rossum (home page: http://www.python.org/~guido/)
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