At 12:48 AM 3/29/2006 -0500, Fred L. Drake, Jr. wrote: >Agreed, but... guess we can't have everything. On the other hand, something >like: > > class Foo: > """Documentation is good.""" > > @class implements(IFoo) > >is not ambiguous. Hmm. It even says what it means. :-)
Interesting. I might have to rename some of my decorators to read well that way, though. I'll play around with the idea a bit. Of course, one of my use cases for class-level declarations is to work around the fact that decorators can't be applied to arbitrary attributes of a class, only to methods. Hm. Let me see: class SomeThing: """Some docs""" @class security.permissions( foo = security.Anybody, bar = myapp.User, ... ) class SomeCommand: """usage: some_command [-v|-q] [-f FILENAME] ...""" @class options.accept( verbose = [ options.Set('-v', '--verbose', value=True, help="Be loud"), options.Set('-q', '--quiet', value=False, help="Be quiet") ], filename = [ options.Set('-f', '--file', type=str, metavar="FILENAME") ] ) Not bad. Not bad at all. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com