wrapt
wrapt copied to clipboard
A Python module for decorators, wrappers and monkey patching.
It would be profoundly helpful to provide a walkthrough, demonstrating how to convert common existing decorator patterns, to use the wrapt package. Take a simple case, of a decorator that...
Using tf2onnx with the following requirements I ran into a to me unexplainable error. The problem came out of no where, as the same code worked only days before. requirements:...
Without setting the `WRAPT_DISABLE_EXTENSIONS` environment variable, there is currently no way to specifically import the pure Python implementation of `ObjectProxy`. My use case requires the Python implementation to allow me...
```python class memoized_property(object): """A read-only @property that is only evaluated once.""" def __init__(self, fget, doc=None): self.fget = fget self.__doc__ = doc or fget.__doc__ self.__name__ = fget.__name__ def __get__(self, obj, cls):...
Hi, I am using the following function as a decorator for other functions with the help of wrapt.decorator: ``` @wrapt.decorator async def log_function_execution(func, instance, args, kwargs): """ Wrapping CYSDKLogger log...
Hey there! First of all, thanks for this wonderful package. We are currently facing an issue when dealing with "Signature Changing Decorators" functionality, Currently, wrapt allows you to change wrapped...
It was already mentioned in #177, but without any solution offered. The `TestMonkeyPatching.test_wrap_class_method_inherited` test fails: ``` _____________ TestMonkeyPatching.test_wrap_class_method_inherited ______________ self = def test_wrap_class_method_inherited(self): _args = (1, 2) _kwargs = {'one':...
I'm using the amazing `wrapt.synchronized` decorator, but I've just realized that it breaks the typing signature of the wrapped function (using vscode). I tested it with custom `wrapt.decorator` function and...
From reading https://github.com/GrahamDumpleton/wrapt/issues/245, looks like cpython internally doing type check, not class check. The thing is I can't really touch `json.dumps` call site for my use case (and maybe `json.JsonEncoder.default`)....
This PR started out as an alternative to #225 that integrated type hints inline. However, it has since grown and now accomplishes the following: - Drop Python 3.6, 3.7 support;...