Prior posts on the topic of decorators and monkey patching are as follows.
This batch of posts deals with Python decorators, how the simple pattern most people use isn't correct and how to implement a better decorator.
- How you implemented your Python decorator is wrong.
- The interaction between decorators and descriptors.
- Implementing a factory for creating decorators.
- Implementing a universal decorator.
- Decorators which accept arguments.
- Maintaining decorator state using a class.
- The missing @synchronized decorator.
- The @synchronized decorator as context manager.
- Performance overhead of using decorators.
- Performance overhead when applying decorators to methods.
- Transparent object proxies in Python.
This batch of posts deals with issues around the more general problem of monkey patching Python code.
- Safely applying monkey patches in Python.
- Using wrapt to support testing of software.
- Ordering issues when monkey patching in Python.
- Automatic patching of Python applications.
Later posts on wrapt, covering what the package can do now, are collected under practical uses for the wrapt package, and the wrapture posts cover a separate package built on the same machinery for testing and tracing.