Nick Coghlan <[EMAIL PROTECTED]> added the comment: The way to override _deref/_unwrap is to make _target a property on a ProxyMixin subclass (which reminds me, I want to put in an explicit test case to make sure that works as intended - I'll use the weakref-proxy-in-Python as the example, so I'll also need to fix the docs to indicate that such a thing doesn't actually require rewriting the whole class).
And there are a lot more use cases than just the ones you listed, primarily in the area of interface adaptation (i.e. the programmer just wants to fiddle with the visible API of the object a bit, rather than doing anything clever with the way the proxy's target is referenced). The reason I'm wary of attempting to provide direct support for the distributed communications use case, is that distributed computing needs to deal with all sorts of issues in relation to serialisation and transport of arguments and return values, that a local proxy of any kind simply doesn't have to deal with (since it can just pass direct references around). Note that merely diverting everything through __getattribute__ isn't even close to enough, due to the argument and return value transport problem - the RPC mechanism needs to understand the methods that are being invoked as well. So I'm quite happy leaving all those issues to tools that are actually designed to handle them (CORBA, XML-RPC, etc). ____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue643841> ____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com