84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
在看openstack nova 的代码的时候,看到这样的一个函数,请问下这个装饰器装饰的函数是什么意思啊?装饰器是一个类?原函数是这样的:用一个类可以装饰一个函数?那会去调用到这个类中的哪个函数去装饰这个函数?是这个类中的__init__方法吗?
欢迎选择我的课程,让我们一起见证您的进步~~
is__call__method
__call__
To write a decorator using a category, you must accept the modified parameter from__init__.__init__裡面接受被修飾者參數。
__init__
而類之所以能夠被呼叫,是因為他有定義了__call__
Operations to handle HTTP requests
is
__call__
methodTo write a decorator using a category, you must accept the modified parameter from
__init__
.__init__
裡面接受被修飾者參數。而類之所以能夠被呼叫,是因為他有定義了
The reason why a class can be called is because it has defined the__call__
__call__
method. ##Operations to handle HTTP requests