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 to overwrite an attribute on the ObjectProxy object without modifying the attribute on the wrapped object.
wrapper = ObjectProxy(obj)
object.__setattr__(wrapper, "mymethod", wrapped_mymethod)
assert obj.mymethod is not wrapped_mymethod
assert wrapper.mymethod is wrapped_mymethod
Without setting the
WRAPT_DISABLE_EXTENSIONS
environment variable, there is currently no way to specifically import the pure Python implementation ofObjectProxy
.My use case requires the Python implementation to allow me to overwrite an attribute on the
ObjectProxy
object without modifying the attribute on the wrapped object.