J
jsceballos
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.thisIsTheMethodName()
The handler object is the same in all methods.
I was wondering if there is a way to simplify this proxy class, maybe
using some pythonic technique like metaclasses, introspection... any
suggestion is appreciated.
Thanks,
Javier Sanz
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.thisIsTheMethodName()
The handler object is the same in all methods.
I was wondering if there is a way to simplify this proxy class, maybe
using some pythonic technique like metaclasses, introspection... any
suggestion is appreciated.
Thanks,
Javier Sanz