且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有适用于Python的AOP支持库?

更新时间:2023-02-16 16:04:30

我不再维护pytilities,并且多年来一直未对其进行维护.您可能需要考虑其他答案之一,或者是Wikipedia上的列表.

I no longer maintain pytilities and it has been unmaintained for years. You may want to consider one of the other answers instead or this list on Wikipedia.

另一个适用于python的AOP库为 pytilities ( svn回购).据我所知,它是目前功能最强大的.

Another AOP library for python would be pytilities (Documentation; svn repo). It is currently the most powerful (as far as I know).

它的功能是:

  • 制作可重用的Aspect类
  • 将多个方面应用于实例或类
  • 取消将方面应用于实例/类
  • 使用方面将新属性添加到实例
  • 将建议应用于实例/类的所有属性
  • ...

它还具有其他优点,例如一些特殊的描述符(请参阅文档)

It also has other goodies such as some special descriptors (see the documentation)