Greg Ewing <greg at cosc.canterbury.ac.nz> writes: > To allow for dynamic insertion of a sequence of wrappers, I can > think of two possibilities: > > (A) Allow a list or tuple of further items to be used as an item. > > (B) Allow a '*' before an item to mean that the item is to > be treated as a sequence of items to be iterated over. (C) Define a function that takes a sequence of decorators and returns a decorator that applies all decorators. E.g. def decorators(decs): def apply_decorators(f): for d in decs: f = d(f) return f return apply_decorators def f(x) [decorators([foo, bar])]: pass This scheme would have the advantage that it doesn't require any additional syntax. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/
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