I just wanted to say that I believe it should be allowed to decorate classes. There's not reason enough (reading the thread linked to by the PEP) to limit decorators this way. Like said several times in that thread, metaclasses are harder (to write and to understand) than decorators. Also, considering that you said you would have actually wanted docstrings above the definition of a function, wouldn't this apply to classes as well? Anyway, it's an artificial limit and it would be better to be able to test it out during the alpha. //Simon > Guido van Rossum wrote: > > > > Some people have argued that it should work for classes (Java and C# > > decorators work for any declaration). I've never been convinced, > > although I'm not dead set against it either. > > > > It would seem that the functionality isn't quite as useful there; you > > can get most of the same effects with metaclasses. I'm not aware of > > any idiom that takes a class and passes it through some kind of > > wrapper or transformation *after* the class declaration; if somebody > > is using this, it surely must be a very rare use indeed. > >
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