On 6/5/2012 8:09 AM, nick.coghlan wrote: > Add PEP 422: Dynamic Class Decorators > +Iterating over decorator entries in reverse order > +------------------------------------------------- > + > +This order was chosen to match the layout of lexical decorators when > +converted to ordinary function calls. Just as the following are equivalent:: > + > + @deco2 > + @deco1 > + class C: > + pass > + > + class C: > + pass > + C = deco2(deco1(C)) > + > +So too will the following be roughly equivalent (aside from inheritance):: > + > + class C: > + __decorators__ = [deco2, deco1] I think you should just store the decorators in the correct order of use + __decorators__ = [deco1, deco2] and avoid the nonsense (time-waste) of making an indirect copy via list_iterator and reversing it each time the attribute is used. If the list is constructed in reversed order, immediately reverse it. > + > + class C: > + pass > + C = deco2(deco1(C)) Terry Jan Reedy
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