I\'d like to create a Python decorator that can be used either with parameters:
@redirect_output(\"somewhere.log\") def foo(): ....
or
Generally you can give default arguments in Python...
def redirect_output(fn, output = stderr): # whatever
Not sure if that works with decorators as well, though. I don't know of any reason why it wouldn't.