wrapt

2.1.2 · active · verified Sat Mar 28

wrapt is a Python module designed for decorators, wrappers, and monkey patching. It emphasizes correctness and transparency, ensuring that decorators preserve introspectability and function signatures. The current version is 2.1.2, with a release cadence that reflects active maintenance and updates.

Warnings

Install

Imports

Quickstart

This example demonstrates creating a simple pass-through decorator using wrapt.

import wrapt

@wrapt.decorator
def pass_through(wrapped, instance, args, kwargs):
    return wrapped(*args, **kwargs)

@pass_through
def function():
    print("Function executed")

function()

view raw JSON →