[Python-Dev] Issue 643841: Including a new-style proxy base class in 2.6/3.0

Greg Ewing greg.ewing at canterbury.ac.nz
Wed May 28 02:30:04 CEST 2008


Armin Ronacher wrote:
> I'm currently not
> providing any __r*__ methods as I was too lazy to test on each call if the
> method that is proxied is providing an __rsomething__ or not, and if not come up
> with an ad-hoc implementation by calling __something__ and reversing the
> arguments passed.

I don't see why you should have to do that, as the reversed
method of the proxy will only be called if a prior non-reversed
call failed.

All the proxy should have to do is delegate any lookups of its
own reversed methods to corresponding methods of the proxied
object, no differently from any other method.

-- 
Greg


More information about the Python-Dev mailing list