Consider a simple-minded decorator that doesn't care about the signature of
the function it wraps:
def noisy(f): .... def g(*args, **kw):
.... print f.__name__
.... return f(*args, **kw)
.... return g
.... @noisy .... def naught():
.... "does nothing"
.... naught() naught
Now help() is less than helpful:
help(naught)
Help on function g:
g(*args, **kw)
While the docstring can easily be copied and might even be prefixed
g.__doc__ = "@noisy\n" + f.__doc__
the name currently can not. I do not see a way to preserve the signature
either. It seems that when decoration is a built-in feature that even has
syntax support it should play nice in these cases by default. Any ideas?
Could there be a smooth way to quote an argument list, e. g:
def f(a, b, c): pass
def g(/*same args as f*/): pass
Peter