On Thu, 2004-04-01 at 09:47, Phillip J. Eby wrote: > as [implementorOf(IFoo, forTypes=[Bar])] > class FooToBarAdapter: > ... > > and it could also be on the same line, e.g.: > > as [classmethod] def blah(cls): > ... > > It reads a bit better with function definitions than with classes, but it's > not too bad. Agreed, I missed this one. It's not too bad with classes if you can warp your mind to think of "to class" as a verb like "to define". > It's more of a replacement for the *[decorators] syntax than > the 'decorate:' syntax, but it's an English word rather than a symbol, > which brings back a bit more of the "Python look and feel". One minor nit, why use the brackets at all? as sychronized, sharkfin(size=10) def VWBug(...): that looks better to me than: as [sychronized, sharkfin(size=10)] def VWBug(...): without brackets it looks more to me like Python, you'd never see: from foo import [bar, baz] For longer lists of decorators use the familiar tuple rule, wrap in parens: as (sychronized, sharkfin(size=10), deprecated) def VWBug(...): -Michel
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