zeekay / decorum

Python decorator helper library.
MIT License
14 stars 2 forks source link

Decorum class runs wrapped function via a `call()` method #23

Closed benoitbryon closed 9 years ago

benoitbryon commented 9 years ago

At the moment, decorum.Decorum offers two entry points to customize decorators:

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.

benoitbryon commented 9 years ago

About the name: run() or call()? call() would mimic __init__() => init(). Whereas run() may avoid some confusions with __call__().

zeekay commented 9 years ago

Makes sense, I like call().