Does Python have decorators in the standard library?

前端 未结 4 642
太阳男子
太阳男子 2021-02-18 17:38

Apart from @staticmethod and @classmethod? Most languages have some basic libraries making use of most of the language features.

It seems that

4条回答
  •  死守一世寂寞
    2021-02-18 17:54

    Python decorators are just plain functions or other callables which take as single argument the function or class to be decorated. As such you can use many ordinary functions as decorators and vice versa. Possible use as decorator is often not explicitly documented.

提交回复
热议问题