任何适用于 Python 的 AOP 支持库? [英] Any AOP support library for Python?

查看:27
本文介绍了任何适用于 Python 的 AOP 支持库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 Python 编程中使用一些 AOP,但我对现有的各种库没有任何经验.

I am trying to use some AOP in my Python programming, but I do not have any experience of the various libraries that exist.

所以我的问题是:

Python 有哪些 AOP 支持?以及它们之间的不同库的优势是什么?

What AOP support exists for Python? And what are the advantages of the differents libraries between them?

<小时>

编辑

我找到了一些,但我不知道它们如何比较:


Edit

I've found some, but I don't know how they compare:

我将在什么情况下使用这些?

In which context will I use these?

我有两个用 Python 编写的应用程序,它们通常具有计算税收和其他金钱事物的方法.我希望能够编写功能的骨架",并在运行时对其进行自定义,例如更改地方税收的应用方式(按国家/地区、州或城市等),而不必超载全栈.

I have two applications, written in Python, which have typically methods which compute taxes and other money things. I'd like to be able to write a "skeleton" of a functionality, and customize it at runtime, for example changing the way local taxes are applied (by country, or state, or city, etc.) without having to overload the full stack.

推荐答案

我不再维护 pytilities,而且多年来一直无人维护.您可能需要考虑其他答案之一或这个维基百科上的列表.

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 repo).它是目前最强大的(据我所知).

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

它的特点是:

  • 制作可重用的方面类
  • 将多个方面应用于实例或类
  • 取消对实例/类应用方面
  • 使用方面向实例添加新属性
  • 将通知应用于实例/类的所有属性
  • ...

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

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

这篇关于任何适用于 Python 的 AOP 支持库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆