面向方面编程
aop的Python项目详细描述
#建议
[面向方面的编程](https://en.wikipedia.org/wiki/aspect-oriented嫒u programming)
修复星号导入
1。修补已经导入的对象(`patch_project`)
\usage
``python
import aop
def multiply(context):
print(context.args)
print(context.kwargs)
yield
context.result*=100
handler=multiply,
modules=aop.match(等于'math'),
targets=aop.match(regexp='(s in cos)
)
``````
好的,让我们检查一下:
``python
in[2]:在[3]中导入math
in[3]:math.cos(0)
(0,)
{
out[3]:100.0
```
[面向方面的编程](https://en.wikipedia.org/wiki/aspect-oriented嫒u programming)
修复星号导入
1。修补已经导入的对象(`patch_project`)
\usage
``python
import aop
def multiply(context):
print(context.args)
print(context.kwargs)
yield
context.result*=100
modules=aop.match(等于'math'),
targets=aop.match(regexp='(s in cos)
)
``````
好的,让我们检查一下:
``python
in[2]:在[3]中导入math
in[3]:math.cos(0)
(0,)
{
out[3]:100.0
```