Status of wrapt (September 2025) - Graham Dumpleton
Briefly

"Back then, constructing decorators using function closures had various short comings and the resulting wrappers didn't preserve introspection and various other attributes associated with the wrapped function. Many of these issues have been resolved in updates to Python and the functools.wraps helper function, but wrapt based decorators were still useful for certain use cases such as being able to create a decorator where you could work out whether it was applied to a function, instance method, class method or even a class."
"It is hard to tell how many people directly use wrapt, but helped by it being used internally in some widely used Python packages has actually resulted in wrapt making it into the list of PyPi top 100 packages by number of downloads. As I write this post it sits at position number 65, but it was at one point as high as about position 45."
"Most changes over recent years have focused around ensuring it works with each new Python version and expanding on the set of Python wheels that are being released for different architectures. There are occassionaly bug fixes or tweaks but generally they relate to corner cases which have arisen due to people trying to do strange things when monkey patching code."
wrapt began as a module for monkey patching Python code and its wrapper object evolved into a foundation for creating decorators. Early decorator implementations using closures failed to preserve introspection and other function attributes, and subsequent Python updates and functools.wraps addressed many issues. wrapt remained valuable for use cases that require distinguishing whether a decorator was applied to a function, instance method, class method, or a class. Usage expanded partly through internal adoption in widely used packages, placing wrapt in PyPI's top 100 by downloads. The project has been kept in maintenance mode, focusing on compatibility, wheel support, and occasional corner-case fixes, with a planned version jump to 2.0.x.
Read at Grahamdumpleton
Unable to calculate read time
[
|
]