I think one important thing to keep in mind is that many decorated methods end up being very similar, and hence you would want the syntax to allow for compressing them. For instance, one would want to be able to write the following code block: class Example(object): def foo(self, *args) [ synchronized(lock), attributes(author='SWH', protocol=IMyProtocol), myArgumentWireMarshaller, ]: pass # Code goes here def bar(self, *args) [ synchronized(lock), attributes(author='SWH', protocol=IMyProtocol), myArgumentWireMarshaller, ]: pass # Code goes here def baz(self, *args) [ synchronized(lock), attributes(author='SWH', protocol=IMyProtocol), myArgumentWireMarshaller, ]: pass # Code goes here more like: class Example(object): IMyProtocolMethod = [ synchronized(lock), attributes(author='SWH', protocol=IMyProtocol), myArgumentWireMarshaller, ] def foo(self, *args) [methodreturns(float)] + IMyProtocolMethod: pass # Code goes here def bar(self, *args) [methodreturns(str)] + IMyProtocolMethod: pass # Code goes here def baz(self, *args) [methodreturns(int)] + IMyProtocolMethod: pass # Code goes here I think that as decorators get used more and more, we will want some way to shorthand a long list of common decorators. Note that I'm not sold on the exact syntax, just the need for the shorthand in a maintainable system. After all, copy and paste gets very sticky over time. Thanks, -Shane
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