Closed benoitbryon closed 9 years ago
At the moment, decorum.Decorum offers two entry points to customize decorators:
decorum.Decorum
init()
wraps()
What about adding a third one to run the wrapped function? It would be useful to customize things such as:
Overriding __call__() would be a bit tricky, because it does some magic, just like __init__(). That's why a new method would be appreciated.
__call__()
__init__()
About the name: run() or call()? call() would mimic __init__() => init(). Whereas run() may avoid some confusions with __call__().
run()
call()
Makes sense, I like call().
At the moment,
decorum.Decorum
offers two entry points to customize decorators:init()
setups the decorator instance;wraps()
actually decorates the function.What about adding a third one to run the wrapped function? It would be useful to customize things such as:
Overriding
__call__()
would be a bit tricky, because it does some magic, just like__init__()
. That's why a new method would be appreciated.