Posts on using wrapt, the Python package for decorators, wrappers and monkey patching, are as follows. The earlier posts which work through why the usual decorator pattern is wrong, and how wrapt came to exist, are collected separately under decorators and monkey patching.
Where wrapt fits against the pattern most people reach for first:
Release news, and the state of the package:
This batch of posts is a set of recipes for things decorators are asked to do, each of which is harder than it looks without a proper object proxy underneath:
- Stateful decorators in wrapt.
- Per-instance lru_cache using wrapt.
- Reshaping decorated functions with wrapt.
- Async support for wrapt.synchronized.
This batch of posts deals with deferring work until something is actually used, both for imports and for the patches applied to them:
This batch of posts looks at how an object proxy behaves when the object being wrapped does not cooperate, and how to tell a proxy from the real thing:
The wrapture posts cover a separate package built on top of wrapt, which applies the same machinery to unit testing and tracing.