mk wrote:
Hello everyone,
I rewrote an example someone posted here recently from:
>>> def print_method_name(method):
def new_meth(*args, **kwargs):
print method.func_name
return method(*args, **kwargs)
return new_meth
>>> @print_method_name
def f2():
pass
>>> f2
mk wrote:
> Note that function decorator returned None, while class decorator
> returned function.
>
> Why the difference in behavior? After all, print_method_name decorator
> also returns a function (well it's a new function but still a function)?
That would be because the function decorator