Registry / testing / wrapt
library2.3.0pypypi✓ verified 29d ago

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.

pip install wrapt
INSTALL
IMPORT
SIG · WRAPT
W
wrapt
testingpythonv2.3.0
Install
2.2s avg
Import
273ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.290s · 18.5MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.256s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

decorator
✓ from wrapt import decorator
✗ from wrapt.decorators import decorator
The correct import is directly from wrapt; importing from wrapt.decorators is incorrect.

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()
Debug
Known issues
breakingIn Python 3.13, the behavior of @classmethod.__get__() was reverted to its pre-3.9 state, affecting decorators applied inside @classmethod.
fix
Apply decorators outside of @classmethod to ensure correct behavior.
affects: Python 3.13
gotchaUsing a decorated class with super() requires accessing the original wrapped class to avoid issues.
fix
Use super(OriginalClass, self).__init__() instead of super().__init__() within decorated classes.
affects: All versions
gotchaDeriving from a decorated class necessitates using the original wrapped class as the base to prevent inheritance issues.
fix
Use Base.__wrapped__ as the base class when deriving from a decorated class.
affects: All versions
gotchaUsing issubclass() on abstract classes decorated with wrapt can raise TypeError due to Python's handling of abstract base classes.
fix
Avoid using issubclass() on decorated abstract classes or access the original class using __wrapped__.
affects: All versions
gotchaUninstalling wrapt improperly can lead to Python runtime errors, especially if other packages depend on it.
fix
Ensure wrapt is reinstalled correctly if uninstallation causes issues, particularly when other packages rely on it.
affects: All versions
Upgrade
Version history
2.3.0latest on PyPI · released Jul 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
1
Resources