Phillip J. Eby wrote: > At 06:48 PM 2/19/04 -0500, Jewett, Jim J wrote: > >> I think this may be one reason this didn't happen before; >> wrapping is good, but it isn't entirely obvious how to >> write it or exactly what it should mean. Given that, it >> might be premature to use up the [] syntax. > > > Well, I personally prefer the 'as' syntax for both class and function > decorators. > > As for the semantics of class decorators, I would propose that they be > identical to the semantics for function decorators. I don't think > there's a point to adding more ways to spell '__metaclass__'. :) Do you mean: class decorated as decorator: pass is equivalent to: class decorated: pass decorated = decorator(decorated) ? And to get PJE's example to work would require a 'protocol decorator' method such as 'IFoo_decorator' which took a class as an argument, told PyProtocols about the class and the interface it supports, and then returned either the original class, or a suitably changed version? Regards, Nick. -- Nick Coghlan | Brisbane, Australia Email: ncoghlan at email.com | Mobile: +61 409 573 268
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