Closed rominf closed 3 years ago
Can you explain the use case for this with examples. I can't see why something line this needs to be a part of wrapt
itself.
Sure. See module-wrapper
library: https://github.com/rominf/module-wrapper/blob/master/module_wrapper/__init__.py#L56. This library recursively wraps modules, wrapping all callables to wrapper
. I needed ClassProxy
class to wrap other classes. If I used inheritance, and wrapped class instance executed some method in the method, called by the user, wrapped class would execute method from wrapper class, not from wrapped class. I couldn't use ObjectProxy
, because I needed to wrap class, but not objects.
Needs docs and/or tests.
https://github.com/herczy/class_proxy is quite a good example of what I would expect from a class proxy, as is predecessor https://github.com/zyga/padme
Going to close this PR out. The utility of this was never really clear and not something that arises enough to be included in a generic package.
Coverage increased (+1.4%) to 93.895% when pulling 0197ea50443722c9aa40b7e8abd24bd5ef780fc3 on rominf:class-wrapper into 9c9ee09599957c0ef889e7cd5aacb79f7954c81e on GrahamDumpleton:develop.