Re: Help in using introspection to simplify repetitive code

2006-08-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > As you mention, wether the methods take arguments or not is something > to have into account. > And they do take arguments, and a variable number of them, so AFAIK > hooking with __getattr__ or __getattribute__ will not work, as you can > only get the method name with

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread Tim N. van der Leeuw
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > And they do take arguments, and a variable number of them, so AFAIK > > hooking with __getattr__ or __getattribute__ will not work, as you can > > only get the method name with that. > > why not just return the bound method *object* (a callable

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > And they do take arguments, and a variable number of them, so AFAIK > hooking with __getattr__ or __getattribute__ will not work, as you can > only get the method name with that. why not just return the bound method *object* (a callable), and let the caller call that a

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread [EMAIL PROTECTED]
As you mention, wether the methods take arguments or not is something to have into account. And they do take arguments, and a variable number of them, so AFAIK hooking with __getattr__ or __getattribute__ will not work, as you can only get the method name with that. I was thinking of some __call__

Re: Help in using introspection to simplify repetitive code

2006-08-20 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. > I'm writing a proxy class, i.e: a class whose methods mostly delegate > their functionality to other class object. Most of the methods (which > are quite a lot) defined in the class would end up being: > > def thisIsTheMethodN

Re: Help in using introspection to simplify repetitive code

2006-08-20 Thread Simon Percivall
[EMAIL PROTECTED] wrote: > Hello. > I'm writing a proxy class, i.e: a class whose methods mostly delegate > their functionality to other class object. Most of the methods (which > are quite a lot) defined in the class would end up being: > > def thisIsTheMethodName(self): > self._handlerClass.