#wrapt

[ follow ]
JavaScript
fromGrahamdumpleton
6 days ago

Reshaping decorated functions with wrapt - Graham Dumpleton

wrapt provides decorators that modify runtime introspection so tools see the wrapper’s calling and coroutine shape, not the wrapped target’s.
Python
fromGrahamdumpleton
6 days ago

Lazy monkey patching with wrapt - Graham Dumpleton

wrapt provides deferred monkey patching to instrument Python without user code changes, and a new module-name modifier improves composition with lazy imports.
#python
Python
fromGrahamdumpleton
6 days ago

Stateful decorators in wrapt - Graham Dumpleton

Wrapt 2.2.0 adds a helper that simplifies creating decorators that retain and expose state across calls, including for methods.
JavaScript
fromGrahamdumpleton
6 days ago

Per-instance lru_cache using wrapt - Graham Dumpleton

wrapt.lru_cache provides a thin wrapper around functools.lru_cache that correctly handles instance methods without changing caching behavior or eviction semantics.
fromGrahamdumpleton
7 months ago

Detecting object wrappers - Graham Dumpleton

The best example of this and the reason that wrapt was created in the first place, is to instrument existing Python code to collect metrics about its performance when run in production. Since one cannot expect a customer for an application performance monitoring (APM) service to modify their code, as well as code of the third party dependencies they may use, transparently reaching in and monkey patching code at runtime is the best one can do.
Python
Python
fromGrahamdumpleton
7 months ago

Wrapt version 2.0.0 - Graham Dumpleton

wrapt 2.0.0 is released with removed Python 2.7 accommodations, subtle internal changes, and a major version bump applied out of caution.
Python
fromGrahamdumpleton
7 months ago

Wrapping immutable objects - Graham Dumpleton

ObjectProxy lacked support for several Python special dunder methods, notably matrix multiplication and in-place operator behaviors, delaying wrapt 2.0.0.
fromGrahamdumpleton
7 months ago

Lazy imports using wrapt - Graham Dumpleton

The actual reason wrapt was created was to be able to perform monkey patching of Python code. One key aspect of being able to monkey patch Python code is to be able to have the ability to wrap target objects in Python with a wrapper which acts as a transparent object proxy for the original object. By extending the object proxy type, one can then intercept access to the target object to perform specific actions.
Software development
[ Load more ]