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 wraptVerified import paths — ran on the pinned version, not inferred.
This example demonstrates creating a simple pass-through decorator using wrapt.
Apply decorators outside of @classmethod to ensure correct behavior.
Use super(OriginalClass, self).__init__() instead of super().__init__() within decorated classes.
Use Base.__wrapped__ as the base class when deriving from a decorated class.
Avoid using issubclass() on decorated abstract classes or access the original class using __wrapped__.
Ensure wrapt is reinstalled correctly if uninstallation causes issues, particularly when other packages rely on it.
No dependency data recorded yet.