I've seen in several places, but I still don't know what is the usage of '@' in python.
For example here:
class C:
@staticmethod
def f(arg1, arg2, ...): ...
Could someone make this all thing clear for me?
I've seen in several places, but I still don't know what is the usage of '@' in python.
For example here:
class C:
@staticmethod
def f(arg1, arg2, ...): ...
Could someone make this all thing clear for me?
@ is for decorators. A decorator is the name used for a software design pattern. Decorators dynamically alter the functionality of a function, method, or class without having to directly use subclasses or change the source code of the function being decorated.