This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients PiDelport, Rhamphoryncus, barry, georg.brandl, jcea, jkrukoff, ncoghlan, terry.reedy
Date 2008-05-24.00:25:52
SpamBayes Score 0.0001028155
Marked as misclassified No
Message-id <1211588773.48.0.0611931204896.issue643841@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2008-05-24 00:26:16ncoghlansetspambayes_score: 0.000102816 -> 0.0001028155
recipients: + ncoghlan, barry, georg.brandl, terry.reedy, jcea, Rhamphoryncus, jkrukoff, PiDelport
2008-05-24 00:26:13ncoghlansetspambayes_score: 0.000102816 -> 0.000102816
messageid: <1211588773.48.0.0611931204896.issue643841@psf.upfronthosting.co.za>
2008-05-24 00:26:11ncoghlanlinkissue643841 messages
2008-05-24 00:25:57ncoghlancreate