Generating a stub class

Irmen de Jong irmen at NOSPAM-REMOVETHIS-xs4all.nl
Fri Dec 6 13:13:50 EST 2002


Gerson Kurz wrote:
> I had some problems creating a dynamic stub class, but finally managed
> to find a way. I was wondering if there is a more pythonic way to
> achive the result. 

Have a look at how I did this in Pyro.  (pyro.sourceforge.net)
Basically, the stub class intercepts the method calls with
a custom __call__ implementation.
It then forwards the call to the actual object.
Which sits on another machine, in Pyro's case ;-)

Irmen




More information about the Python-list mailing list