"@" Decorator (in Python)
Possible Duplicate: Understanding Python decorators What function does the 'class decorator'/'method decorator' (@) serve? In other words, what is the difference between this an
@decoratordeffunction(args):
#body
is just syntactic sugar for:
def function(args):
#bodyfunction = decorator(function)
That's really it.
As you see, the decorator gets called, so it's by no means a comment.
You may like these posts
Post a Comment for ""@" Decorator (in Python)"