Skip Montanaro <skip at pobox.com> writes: > (still catching up...) > > Simon> I just wanted to say that I believe it should be allowed to > Simon> decorate classes. There's not reason enough (reading the thread > Simon> linked to by the PEP) to limit decorators this way. Like said > Simon> several times in that thread, metaclasses are harder (to write > Simon> and to understand) than decorators. > > While it might be perceived as a limitation there's nothing preventing its > addition in a later version if warranted. I believe most/all the various > proposals on the PythonDecorators wiki, not just the pie syntax, could be > easily adapted to class decoration. I was going for replacing the module's dict with a dict subclass, and hooking __setitem__ it as an alternative to using settrace to implement this. It's not allowed, though :(. We also need a way to say, "replace the dict into which new definitions are falling" so we can implement decorators inside of class definitions. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
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