> > This could be used to define a decorator > > @copyfuncattrs > def trace(f): > def do_trace(*args): > print "invoking", f.__name__, args > return f(*args) > return do_trace I am quite new in Python, and I do my first suggestions. (One time I should begin) If there is a general agreement about what to do to wrap a decorator, why no use the following syntax @decorator def trace(f): def do_trace(*args): print "invoking", f.__name__, args return f(*args) return do_trace I would prefer it because it explain what the method do instead of how it implement it. Generally speaking, I believe the decarators should be very expressive, just because even if it is not a part of the language, it's a kind of new syntax. For the same reason, Python should incorporate just a reduce set of decorators.
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