Phillip Eby: > Is it the name you dislike? Or the idea of simply > invoking decorating functions directly? If decorate is a callable class rather than a function, it can be subclassed for common idioms. The question is whether or not this is a good idea. Any specific use will be more clear with a usage-specific name, but the construct as a whole may be muddied if nothing ties these names together. For instance, it classmethod were subclassed from decorate (but used current usage when it got an argument), you could write classmethod() def f(): pass But you would also see things like dec1() # No good way to chain decorators. def g(): pass g=dec2(g) Personally, I want decorators tied together with a word (such as "decorate" or "using"), but I admit that list brackets + line-break *might* be enough. decorators(classmethod()) def f(): pass decorators(dec1(), dec2()) def g(): pass vs [classmethod()] def f(): pass [dec1(), dec2()] def g(): pass -jJ
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