Aspect-oriented programming

Parts of aspect-oriented programming (AOP) are implemented by decorators in Python. Our purpose here is to leverage a few aspect-oriented concepts to help show the purpose of decorators and mixins in Python. The idea of a cross-cutting concern is central to AOP. While the Wikipedia page ( is generally kept up-to-date, older information is available here: The Spring framework provides some ideas; see also There are several common examples of cross-cutting concerns, as follows:

  • Logging: We often need to have ...

Get Mastering Object-Oriented Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.