I know about @staticmethod, @classmethod, and @property, but only through scattered documents. What function is the complete list of decorators that have been created in Python?
I do not think so. Decorations are not different from simple tasks, you only call them in an imaginary way.
Try the search list to find them all, because as you can see in decorator syntax only Is a syntactic sugar, because the following two definitions make the same work (from the vocabulary of this example are copied):
def f (...): ... f = staticmethod ( F) @staticmethod def F (...):
If any Trnihit function which can be used as a decorator gives another function question - what makes sense to use it in this way? : -)
The module contains some functions that can be used as decorations, but they are not built-in for you.
Comments
Post a Comment