[issue19070] In place operators of weakref.proxy() not returning self.

Graham Dumpleton report at bugs.python.org
Mon Oct 7 12:06:22 CEST 2013


Graham Dumpleton added the comment:

The proxy is intended as a wrapper around an object, it is not intended to merge in some way with the wrapped object. The wrapped object shouldn't really ever be aware that it was being accessed via a proxy. Thus the expectation that the 'self' attribute of the methods of the wrapper object would actually be the proxy object is a strange one.

Can you explain why you need it to behave the way you are expecting? Also specifically indicate what requirement you have for needing the reference to the wrapped object to be a weakref?

Almost sounds a bit like you may be trying to use weakref.proxy in a way not intended.

It is technically possible to write an object proxy which would work how you are expecting, but the Python standard library doesn't provide an object proxy implementation to base such a thing on.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19070>
_______________________________________


More information about the Python-bugs-list mailing list